org.hl7.fhir.Specimen Maven / Gradle / Ivy
Show all versions of quick Show documentation
//
// This file was generated by the Eclipse Implementation of JAXB, v3.0.2
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2024.03.21 at 12:42:34 PM MDT
//
package org.hl7.fhir;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.HashCode2;
import org.jvnet.jaxb2_commons.lang.HashCodeStrategy2;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString2;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
/**
* If the element is present, it must have either a @value, an @id, or extensions
*
* Java class for Specimen complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="Specimen">
* <complexContent>
* <extension base="{http://hl7.org/fhir}DomainResource">
* <sequence>
* <element name="identifier" type="{http://hl7.org/fhir}Identifier" maxOccurs="unbounded" minOccurs="0"/>
* <element name="accessionIdentifier" type="{http://hl7.org/fhir}Identifier" minOccurs="0"/>
* <element name="status" type="{http://hl7.org/fhir}SpecimenStatus" minOccurs="0"/>
* <element name="type" type="{http://hl7.org/fhir}CodeableConcept" minOccurs="0"/>
* <element name="subject" type="{http://hl7.org/fhir}Reference"/>
* <element name="receivedTime" type="{http://hl7.org/fhir}dateTime" minOccurs="0"/>
* <element name="parent" type="{http://hl7.org/fhir}Reference" maxOccurs="unbounded" minOccurs="0"/>
* <element name="collection" type="{http://hl7.org/fhir}Specimen.Collection" minOccurs="0"/>
* <element name="treatment" type="{http://hl7.org/fhir}Specimen.Treatment" maxOccurs="unbounded" minOccurs="0"/>
* <element name="container" type="{http://hl7.org/fhir}Specimen.Container" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Specimen", propOrder = {
"identifier",
"accessionIdentifier",
"status",
"type",
"subject",
"receivedTime",
"parent",
"collection",
"treatment",
"container"
})
public class Specimen
extends DomainResource
implements Equals2, HashCode2, ToString2
{
protected List identifier;
protected Identifier accessionIdentifier;
protected SpecimenStatus status;
protected CodeableConcept type;
@XmlElement(required = true)
protected Reference subject;
protected DateTime receivedTime;
protected List parent;
protected SpecimenCollection collection;
protected List treatment;
protected List container;
/**
* Gets the value of the identifier property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a set
method for the identifier property.
*
*
* For example, to add a new item, do as follows:
*
* getIdentifier().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Identifier }
*
*
*/
public List getIdentifier() {
if (identifier == null) {
identifier = new ArrayList();
}
return this.identifier;
}
/**
* Gets the value of the accessionIdentifier property.
*
* @return
* possible object is
* {@link Identifier }
*
*/
public Identifier getAccessionIdentifier() {
return accessionIdentifier;
}
/**
* Sets the value of the accessionIdentifier property.
*
* @param value
* allowed object is
* {@link Identifier }
*
*/
public void setAccessionIdentifier(Identifier value) {
this.accessionIdentifier = value;
}
/**
* Gets the value of the status property.
*
* @return
* possible object is
* {@link SpecimenStatus }
*
*/
public SpecimenStatus getStatus() {
return status;
}
/**
* Sets the value of the status property.
*
* @param value
* allowed object is
* {@link SpecimenStatus }
*
*/
public void setStatus(SpecimenStatus value) {
this.status = value;
}
/**
* Gets the value of the type property.
*
* @return
* possible object is
* {@link CodeableConcept }
*
*/
public CodeableConcept getType() {
return type;
}
/**
* Sets the value of the type property.
*
* @param value
* allowed object is
* {@link CodeableConcept }
*
*/
public void setType(CodeableConcept value) {
this.type = value;
}
/**
* Gets the value of the subject property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getSubject() {
return subject;
}
/**
* Sets the value of the subject property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setSubject(Reference value) {
this.subject = value;
}
/**
* Gets the value of the receivedTime property.
*
* @return
* possible object is
* {@link DateTime }
*
*/
public DateTime getReceivedTime() {
return receivedTime;
}
/**
* Sets the value of the receivedTime property.
*
* @param value
* allowed object is
* {@link DateTime }
*
*/
public void setReceivedTime(DateTime value) {
this.receivedTime = value;
}
/**
* Gets the value of the parent property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a set
method for the parent property.
*
*
* For example, to add a new item, do as follows:
*
* getParent().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Reference }
*
*
*/
public List getParent() {
if (parent == null) {
parent = new ArrayList();
}
return this.parent;
}
/**
* Gets the value of the collection property.
*
* @return
* possible object is
* {@link SpecimenCollection }
*
*/
public SpecimenCollection getCollection() {
return collection;
}
/**
* Sets the value of the collection property.
*
* @param value
* allowed object is
* {@link SpecimenCollection }
*
*/
public void setCollection(SpecimenCollection value) {
this.collection = value;
}
/**
* Gets the value of the treatment property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a set
method for the treatment property.
*
*
* For example, to add a new item, do as follows:
*
* getTreatment().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link SpecimenTreatment }
*
*
*/
public List getTreatment() {
if (treatment == null) {
treatment = new ArrayList();
}
return this.treatment;
}
/**
* Gets the value of the container property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a set
method for the container property.
*
*
* For example, to add a new item, do as follows:
*
* getContainer().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link SpecimenContainer }
*
*
*/
public List getContainer() {
if (container == null) {
container = new ArrayList();
}
return this.container;
}
public Specimen withIdentifier(Identifier... values) {
if (values!= null) {
for (Identifier value: values) {
getIdentifier().add(value);
}
}
return this;
}
public Specimen withIdentifier(Collection values) {
if (values!= null) {
getIdentifier().addAll(values);
}
return this;
}
public Specimen withAccessionIdentifier(Identifier value) {
setAccessionIdentifier(value);
return this;
}
public Specimen withStatus(SpecimenStatus value) {
setStatus(value);
return this;
}
public Specimen withType(CodeableConcept value) {
setType(value);
return this;
}
public Specimen withSubject(Reference value) {
setSubject(value);
return this;
}
public Specimen withReceivedTime(DateTime value) {
setReceivedTime(value);
return this;
}
public Specimen withParent(Reference... values) {
if (values!= null) {
for (Reference value: values) {
getParent().add(value);
}
}
return this;
}
public Specimen withParent(Collection values) {
if (values!= null) {
getParent().addAll(values);
}
return this;
}
public Specimen withCollection(SpecimenCollection value) {
setCollection(value);
return this;
}
public Specimen withTreatment(SpecimenTreatment... values) {
if (values!= null) {
for (SpecimenTreatment value: values) {
getTreatment().add(value);
}
}
return this;
}
public Specimen withTreatment(Collection values) {
if (values!= null) {
getTreatment().addAll(values);
}
return this;
}
public Specimen withContainer(SpecimenContainer... values) {
if (values!= null) {
for (SpecimenContainer value: values) {
getContainer().add(value);
}
}
return this;
}
public Specimen withContainer(Collection values) {
if (values!= null) {
getContainer().addAll(values);
}
return this;
}
@Override
public Specimen withText(Narrative value) {
setText(value);
return this;
}
@Override
public Specimen withContained(ResourceContainer... values) {
if (values!= null) {
for (ResourceContainer value: values) {
getContained().add(value);
}
}
return this;
}
@Override
public Specimen withContained(Collection values) {
if (values!= null) {
getContained().addAll(values);
}
return this;
}
@Override
public Specimen withExtension(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getExtension().add(value);
}
}
return this;
}
@Override
public Specimen withExtension(Collection values) {
if (values!= null) {
getExtension().addAll(values);
}
return this;
}
@Override
public Specimen withModifierExtension(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getModifierExtension().add(value);
}
}
return this;
}
@Override
public Specimen withModifierExtension(Collection values) {
if (values!= null) {
getModifierExtension().addAll(values);
}
return this;
}
@Override
public Specimen withId(Id value) {
setId(value);
return this;
}
@Override
public Specimen withMeta(Meta value) {
setMeta(value);
return this;
}
@Override
public Specimen withImplicitRules(Uri value) {
setImplicitRules(value);
return this;
}
@Override
public Specimen withLanguage(Code value) {
setLanguage(value);
return this;
}
@Override
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
if (!super.equals(thisLocator, thatLocator, object, strategy)) {
return false;
}
final Specimen that = ((Specimen) object);
{
List lhsIdentifier;
lhsIdentifier = (((this.identifier!= null)&&(!this.identifier.isEmpty()))?this.getIdentifier():null);
List rhsIdentifier;
rhsIdentifier = (((that.identifier!= null)&&(!that.identifier.isEmpty()))?that.getIdentifier():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "identifier", lhsIdentifier), LocatorUtils.property(thatLocator, "identifier", rhsIdentifier), lhsIdentifier, rhsIdentifier, ((this.identifier!= null)&&(!this.identifier.isEmpty())), ((that.identifier!= null)&&(!that.identifier.isEmpty())))) {
return false;
}
}
{
Identifier lhsAccessionIdentifier;
lhsAccessionIdentifier = this.getAccessionIdentifier();
Identifier rhsAccessionIdentifier;
rhsAccessionIdentifier = that.getAccessionIdentifier();
if (!strategy.equals(LocatorUtils.property(thisLocator, "accessionIdentifier", lhsAccessionIdentifier), LocatorUtils.property(thatLocator, "accessionIdentifier", rhsAccessionIdentifier), lhsAccessionIdentifier, rhsAccessionIdentifier, (this.accessionIdentifier!= null), (that.accessionIdentifier!= null))) {
return false;
}
}
{
SpecimenStatus lhsStatus;
lhsStatus = this.getStatus();
SpecimenStatus rhsStatus;
rhsStatus = that.getStatus();
if (!strategy.equals(LocatorUtils.property(thisLocator, "status", lhsStatus), LocatorUtils.property(thatLocator, "status", rhsStatus), lhsStatus, rhsStatus, (this.status!= null), (that.status!= null))) {
return false;
}
}
{
CodeableConcept lhsType;
lhsType = this.getType();
CodeableConcept rhsType;
rhsType = that.getType();
if (!strategy.equals(LocatorUtils.property(thisLocator, "type", lhsType), LocatorUtils.property(thatLocator, "type", rhsType), lhsType, rhsType, (this.type!= null), (that.type!= null))) {
return false;
}
}
{
Reference lhsSubject;
lhsSubject = this.getSubject();
Reference rhsSubject;
rhsSubject = that.getSubject();
if (!strategy.equals(LocatorUtils.property(thisLocator, "subject", lhsSubject), LocatorUtils.property(thatLocator, "subject", rhsSubject), lhsSubject, rhsSubject, (this.subject!= null), (that.subject!= null))) {
return false;
}
}
{
DateTime lhsReceivedTime;
lhsReceivedTime = this.getReceivedTime();
DateTime rhsReceivedTime;
rhsReceivedTime = that.getReceivedTime();
if (!strategy.equals(LocatorUtils.property(thisLocator, "receivedTime", lhsReceivedTime), LocatorUtils.property(thatLocator, "receivedTime", rhsReceivedTime), lhsReceivedTime, rhsReceivedTime, (this.receivedTime!= null), (that.receivedTime!= null))) {
return false;
}
}
{
List lhsParent;
lhsParent = (((this.parent!= null)&&(!this.parent.isEmpty()))?this.getParent():null);
List rhsParent;
rhsParent = (((that.parent!= null)&&(!that.parent.isEmpty()))?that.getParent():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "parent", lhsParent), LocatorUtils.property(thatLocator, "parent", rhsParent), lhsParent, rhsParent, ((this.parent!= null)&&(!this.parent.isEmpty())), ((that.parent!= null)&&(!that.parent.isEmpty())))) {
return false;
}
}
{
SpecimenCollection lhsCollection;
lhsCollection = this.getCollection();
SpecimenCollection rhsCollection;
rhsCollection = that.getCollection();
if (!strategy.equals(LocatorUtils.property(thisLocator, "collection", lhsCollection), LocatorUtils.property(thatLocator, "collection", rhsCollection), lhsCollection, rhsCollection, (this.collection!= null), (that.collection!= null))) {
return false;
}
}
{
List lhsTreatment;
lhsTreatment = (((this.treatment!= null)&&(!this.treatment.isEmpty()))?this.getTreatment():null);
List rhsTreatment;
rhsTreatment = (((that.treatment!= null)&&(!that.treatment.isEmpty()))?that.getTreatment():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "treatment", lhsTreatment), LocatorUtils.property(thatLocator, "treatment", rhsTreatment), lhsTreatment, rhsTreatment, ((this.treatment!= null)&&(!this.treatment.isEmpty())), ((that.treatment!= null)&&(!that.treatment.isEmpty())))) {
return false;
}
}
{
List lhsContainer;
lhsContainer = (((this.container!= null)&&(!this.container.isEmpty()))?this.getContainer():null);
List rhsContainer;
rhsContainer = (((that.container!= null)&&(!that.container.isEmpty()))?that.getContainer():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "container", lhsContainer), LocatorUtils.property(thatLocator, "container", rhsContainer), lhsContainer, rhsContainer, ((this.container!= null)&&(!this.container.isEmpty())), ((that.container!= null)&&(!that.container.isEmpty())))) {
return false;
}
}
return true;
}
@Override
public boolean equals(Object object) {
final EqualsStrategy2 strategy = JAXBEqualsStrategy.getInstance();
return equals(null, null, object, strategy);
}
@Override
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) {
int currentHashCode = super.hashCode(locator, strategy);
{
List theIdentifier;
theIdentifier = (((this.identifier!= null)&&(!this.identifier.isEmpty()))?this.getIdentifier():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "identifier", theIdentifier), currentHashCode, theIdentifier, ((this.identifier!= null)&&(!this.identifier.isEmpty())));
}
{
Identifier theAccessionIdentifier;
theAccessionIdentifier = this.getAccessionIdentifier();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "accessionIdentifier", theAccessionIdentifier), currentHashCode, theAccessionIdentifier, (this.accessionIdentifier!= null));
}
{
SpecimenStatus theStatus;
theStatus = this.getStatus();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "status", theStatus), currentHashCode, theStatus, (this.status!= null));
}
{
CodeableConcept theType;
theType = this.getType();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType, (this.type!= null));
}
{
Reference theSubject;
theSubject = this.getSubject();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "subject", theSubject), currentHashCode, theSubject, (this.subject!= null));
}
{
DateTime theReceivedTime;
theReceivedTime = this.getReceivedTime();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "receivedTime", theReceivedTime), currentHashCode, theReceivedTime, (this.receivedTime!= null));
}
{
List theParent;
theParent = (((this.parent!= null)&&(!this.parent.isEmpty()))?this.getParent():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "parent", theParent), currentHashCode, theParent, ((this.parent!= null)&&(!this.parent.isEmpty())));
}
{
SpecimenCollection theCollection;
theCollection = this.getCollection();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "collection", theCollection), currentHashCode, theCollection, (this.collection!= null));
}
{
List theTreatment;
theTreatment = (((this.treatment!= null)&&(!this.treatment.isEmpty()))?this.getTreatment():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "treatment", theTreatment), currentHashCode, theTreatment, ((this.treatment!= null)&&(!this.treatment.isEmpty())));
}
{
List theContainer;
theContainer = (((this.container!= null)&&(!this.container.isEmpty()))?this.getContainer():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "container", theContainer), currentHashCode, theContainer, ((this.container!= null)&&(!this.container.isEmpty())));
}
return currentHashCode;
}
@Override
public int hashCode() {
final HashCodeStrategy2 strategy = JAXBHashCodeStrategy.getInstance();
return this.hashCode(null, strategy);
}
@Override
public java.lang.String toString() {
final ToStringStrategy2 strategy = JAXBToStringStrategy.getInstance();
final StringBuilder buffer = new StringBuilder();
append(null, buffer, strategy);
return buffer.toString();
}
@Override
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
strategy.appendStart(locator, this, buffer);
appendFields(locator, buffer, strategy);
strategy.appendEnd(locator, this, buffer);
return buffer;
}
@Override
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
super.appendFields(locator, buffer, strategy);
{
List theIdentifier;
theIdentifier = (((this.identifier!= null)&&(!this.identifier.isEmpty()))?this.getIdentifier():null);
strategy.appendField(locator, this, "identifier", buffer, theIdentifier, ((this.identifier!= null)&&(!this.identifier.isEmpty())));
}
{
Identifier theAccessionIdentifier;
theAccessionIdentifier = this.getAccessionIdentifier();
strategy.appendField(locator, this, "accessionIdentifier", buffer, theAccessionIdentifier, (this.accessionIdentifier!= null));
}
{
SpecimenStatus theStatus;
theStatus = this.getStatus();
strategy.appendField(locator, this, "status", buffer, theStatus, (this.status!= null));
}
{
CodeableConcept theType;
theType = this.getType();
strategy.appendField(locator, this, "type", buffer, theType, (this.type!= null));
}
{
Reference theSubject;
theSubject = this.getSubject();
strategy.appendField(locator, this, "subject", buffer, theSubject, (this.subject!= null));
}
{
DateTime theReceivedTime;
theReceivedTime = this.getReceivedTime();
strategy.appendField(locator, this, "receivedTime", buffer, theReceivedTime, (this.receivedTime!= null));
}
{
List theParent;
theParent = (((this.parent!= null)&&(!this.parent.isEmpty()))?this.getParent():null);
strategy.appendField(locator, this, "parent", buffer, theParent, ((this.parent!= null)&&(!this.parent.isEmpty())));
}
{
SpecimenCollection theCollection;
theCollection = this.getCollection();
strategy.appendField(locator, this, "collection", buffer, theCollection, (this.collection!= null));
}
{
List theTreatment;
theTreatment = (((this.treatment!= null)&&(!this.treatment.isEmpty()))?this.getTreatment():null);
strategy.appendField(locator, this, "treatment", buffer, theTreatment, ((this.treatment!= null)&&(!this.treatment.isEmpty())));
}
{
List theContainer;
theContainer = (((this.container!= null)&&(!this.container.isEmpty()))?this.getContainer():null);
strategy.appendField(locator, this, "container", buffer, theContainer, ((this.container!= null)&&(!this.container.isEmpty())));
}
return buffer;
}
public void setIdentifier(List value) {
this.identifier = value;
}
public void setParent(List value) {
this.parent = value;
}
public void setTreatment(List value) {
this.treatment = value;
}
public void setContainer(List value) {
this.container = value;
}
}