org.hl7.fhir.MessageHeader 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.08.16 at 09:36:55 AM 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 MessageHeader complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="MessageHeader">
* <complexContent>
* <extension base="{http://hl7.org/fhir}DomainResource">
* <sequence>
* <element name="timestamp" type="{http://hl7.org/fhir}instant"/>
* <element name="event" type="{http://hl7.org/fhir}Coding"/>
* <element name="response" type="{http://hl7.org/fhir}MessageHeader.Response" minOccurs="0"/>
* <element name="source" type="{http://hl7.org/fhir}MessageHeader.Source"/>
* <element name="destination" type="{http://hl7.org/fhir}MessageHeader.Destination" maxOccurs="unbounded" minOccurs="0"/>
* <element name="enterer" type="{http://hl7.org/fhir}Reference" minOccurs="0"/>
* <element name="author" type="{http://hl7.org/fhir}Reference" minOccurs="0"/>
* <element name="receiver" type="{http://hl7.org/fhir}Reference" minOccurs="0"/>
* <element name="responsible" type="{http://hl7.org/fhir}Reference" minOccurs="0"/>
* <element name="reason" type="{http://hl7.org/fhir}CodeableConcept" minOccurs="0"/>
* <element name="data" type="{http://hl7.org/fhir}Reference" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MessageHeader", propOrder = {
"timestamp",
"event",
"response",
"source",
"destination",
"enterer",
"author",
"receiver",
"responsible",
"reason",
"data"
})
public class MessageHeader
extends DomainResource
implements Equals2, HashCode2, ToString2
{
@XmlElement(required = true)
protected Instant timestamp;
@XmlElement(required = true)
protected Coding event;
protected MessageHeaderResponse response;
@XmlElement(required = true)
protected MessageHeaderSource source;
protected List destination;
protected Reference enterer;
protected Reference author;
protected Reference receiver;
protected Reference responsible;
protected CodeableConcept reason;
protected List data;
/**
* Gets the value of the timestamp property.
*
* @return
* possible object is
* {@link Instant }
*
*/
public Instant getTimestamp() {
return timestamp;
}
/**
* Sets the value of the timestamp property.
*
* @param value
* allowed object is
* {@link Instant }
*
*/
public void setTimestamp(Instant value) {
this.timestamp = value;
}
/**
* Gets the value of the event property.
*
* @return
* possible object is
* {@link Coding }
*
*/
public Coding getEvent() {
return event;
}
/**
* Sets the value of the event property.
*
* @param value
* allowed object is
* {@link Coding }
*
*/
public void setEvent(Coding value) {
this.event = value;
}
/**
* Gets the value of the response property.
*
* @return
* possible object is
* {@link MessageHeaderResponse }
*
*/
public MessageHeaderResponse getResponse() {
return response;
}
/**
* Sets the value of the response property.
*
* @param value
* allowed object is
* {@link MessageHeaderResponse }
*
*/
public void setResponse(MessageHeaderResponse value) {
this.response = value;
}
/**
* Gets the value of the source property.
*
* @return
* possible object is
* {@link MessageHeaderSource }
*
*/
public MessageHeaderSource getSource() {
return source;
}
/**
* Sets the value of the source property.
*
* @param value
* allowed object is
* {@link MessageHeaderSource }
*
*/
public void setSource(MessageHeaderSource value) {
this.source = value;
}
/**
* Gets the value of the destination 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 destination property.
*
*
* For example, to add a new item, do as follows:
*
* getDestination().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link MessageHeaderDestination }
*
*
*/
public List getDestination() {
if (destination == null) {
destination = new ArrayList();
}
return this.destination;
}
/**
* Gets the value of the enterer property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getEnterer() {
return enterer;
}
/**
* Sets the value of the enterer property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setEnterer(Reference value) {
this.enterer = value;
}
/**
* Gets the value of the author property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getAuthor() {
return author;
}
/**
* Sets the value of the author property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setAuthor(Reference value) {
this.author = value;
}
/**
* Gets the value of the receiver property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getReceiver() {
return receiver;
}
/**
* Sets the value of the receiver property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setReceiver(Reference value) {
this.receiver = value;
}
/**
* Gets the value of the responsible property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getResponsible() {
return responsible;
}
/**
* Sets the value of the responsible property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setResponsible(Reference value) {
this.responsible = value;
}
/**
* Gets the value of the reason property.
*
* @return
* possible object is
* {@link CodeableConcept }
*
*/
public CodeableConcept getReason() {
return reason;
}
/**
* Sets the value of the reason property.
*
* @param value
* allowed object is
* {@link CodeableConcept }
*
*/
public void setReason(CodeableConcept value) {
this.reason = value;
}
/**
* Gets the value of the data 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 data property.
*
*
* For example, to add a new item, do as follows:
*
* getData().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Reference }
*
*
*/
public List getData() {
if (data == null) {
data = new ArrayList();
}
return this.data;
}
public MessageHeader withTimestamp(Instant value) {
setTimestamp(value);
return this;
}
public MessageHeader withEvent(Coding value) {
setEvent(value);
return this;
}
public MessageHeader withResponse(MessageHeaderResponse value) {
setResponse(value);
return this;
}
public MessageHeader withSource(MessageHeaderSource value) {
setSource(value);
return this;
}
public MessageHeader withDestination(MessageHeaderDestination... values) {
if (values!= null) {
for (MessageHeaderDestination value: values) {
getDestination().add(value);
}
}
return this;
}
public MessageHeader withDestination(Collection values) {
if (values!= null) {
getDestination().addAll(values);
}
return this;
}
public MessageHeader withEnterer(Reference value) {
setEnterer(value);
return this;
}
public MessageHeader withAuthor(Reference value) {
setAuthor(value);
return this;
}
public MessageHeader withReceiver(Reference value) {
setReceiver(value);
return this;
}
public MessageHeader withResponsible(Reference value) {
setResponsible(value);
return this;
}
public MessageHeader withReason(CodeableConcept value) {
setReason(value);
return this;
}
public MessageHeader withData(Reference... values) {
if (values!= null) {
for (Reference value: values) {
getData().add(value);
}
}
return this;
}
public MessageHeader withData(Collection values) {
if (values!= null) {
getData().addAll(values);
}
return this;
}
@Override
public MessageHeader withText(Narrative value) {
setText(value);
return this;
}
@Override
public MessageHeader withContained(ResourceContainer... values) {
if (values!= null) {
for (ResourceContainer value: values) {
getContained().add(value);
}
}
return this;
}
@Override
public MessageHeader withContained(Collection values) {
if (values!= null) {
getContained().addAll(values);
}
return this;
}
@Override
public MessageHeader withExtension(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getExtension().add(value);
}
}
return this;
}
@Override
public MessageHeader withExtension(Collection values) {
if (values!= null) {
getExtension().addAll(values);
}
return this;
}
@Override
public MessageHeader withModifierExtension(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getModifierExtension().add(value);
}
}
return this;
}
@Override
public MessageHeader withModifierExtension(Collection values) {
if (values!= null) {
getModifierExtension().addAll(values);
}
return this;
}
@Override
public MessageHeader withId(Id value) {
setId(value);
return this;
}
@Override
public MessageHeader withMeta(Meta value) {
setMeta(value);
return this;
}
@Override
public MessageHeader withImplicitRules(Uri value) {
setImplicitRules(value);
return this;
}
@Override
public MessageHeader 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 MessageHeader that = ((MessageHeader) object);
{
Instant lhsTimestamp;
lhsTimestamp = this.getTimestamp();
Instant rhsTimestamp;
rhsTimestamp = that.getTimestamp();
if (!strategy.equals(LocatorUtils.property(thisLocator, "timestamp", lhsTimestamp), LocatorUtils.property(thatLocator, "timestamp", rhsTimestamp), lhsTimestamp, rhsTimestamp, (this.timestamp!= null), (that.timestamp!= null))) {
return false;
}
}
{
Coding lhsEvent;
lhsEvent = this.getEvent();
Coding rhsEvent;
rhsEvent = that.getEvent();
if (!strategy.equals(LocatorUtils.property(thisLocator, "event", lhsEvent), LocatorUtils.property(thatLocator, "event", rhsEvent), lhsEvent, rhsEvent, (this.event!= null), (that.event!= null))) {
return false;
}
}
{
MessageHeaderResponse lhsResponse;
lhsResponse = this.getResponse();
MessageHeaderResponse rhsResponse;
rhsResponse = that.getResponse();
if (!strategy.equals(LocatorUtils.property(thisLocator, "response", lhsResponse), LocatorUtils.property(thatLocator, "response", rhsResponse), lhsResponse, rhsResponse, (this.response!= null), (that.response!= null))) {
return false;
}
}
{
MessageHeaderSource lhsSource;
lhsSource = this.getSource();
MessageHeaderSource rhsSource;
rhsSource = that.getSource();
if (!strategy.equals(LocatorUtils.property(thisLocator, "source", lhsSource), LocatorUtils.property(thatLocator, "source", rhsSource), lhsSource, rhsSource, (this.source!= null), (that.source!= null))) {
return false;
}
}
{
List lhsDestination;
lhsDestination = (((this.destination!= null)&&(!this.destination.isEmpty()))?this.getDestination():null);
List rhsDestination;
rhsDestination = (((that.destination!= null)&&(!that.destination.isEmpty()))?that.getDestination():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "destination", lhsDestination), LocatorUtils.property(thatLocator, "destination", rhsDestination), lhsDestination, rhsDestination, ((this.destination!= null)&&(!this.destination.isEmpty())), ((that.destination!= null)&&(!that.destination.isEmpty())))) {
return false;
}
}
{
Reference lhsEnterer;
lhsEnterer = this.getEnterer();
Reference rhsEnterer;
rhsEnterer = that.getEnterer();
if (!strategy.equals(LocatorUtils.property(thisLocator, "enterer", lhsEnterer), LocatorUtils.property(thatLocator, "enterer", rhsEnterer), lhsEnterer, rhsEnterer, (this.enterer!= null), (that.enterer!= null))) {
return false;
}
}
{
Reference lhsAuthor;
lhsAuthor = this.getAuthor();
Reference rhsAuthor;
rhsAuthor = that.getAuthor();
if (!strategy.equals(LocatorUtils.property(thisLocator, "author", lhsAuthor), LocatorUtils.property(thatLocator, "author", rhsAuthor), lhsAuthor, rhsAuthor, (this.author!= null), (that.author!= null))) {
return false;
}
}
{
Reference lhsReceiver;
lhsReceiver = this.getReceiver();
Reference rhsReceiver;
rhsReceiver = that.getReceiver();
if (!strategy.equals(LocatorUtils.property(thisLocator, "receiver", lhsReceiver), LocatorUtils.property(thatLocator, "receiver", rhsReceiver), lhsReceiver, rhsReceiver, (this.receiver!= null), (that.receiver!= null))) {
return false;
}
}
{
Reference lhsResponsible;
lhsResponsible = this.getResponsible();
Reference rhsResponsible;
rhsResponsible = that.getResponsible();
if (!strategy.equals(LocatorUtils.property(thisLocator, "responsible", lhsResponsible), LocatorUtils.property(thatLocator, "responsible", rhsResponsible), lhsResponsible, rhsResponsible, (this.responsible!= null), (that.responsible!= null))) {
return false;
}
}
{
CodeableConcept lhsReason;
lhsReason = this.getReason();
CodeableConcept rhsReason;
rhsReason = that.getReason();
if (!strategy.equals(LocatorUtils.property(thisLocator, "reason", lhsReason), LocatorUtils.property(thatLocator, "reason", rhsReason), lhsReason, rhsReason, (this.reason!= null), (that.reason!= null))) {
return false;
}
}
{
List lhsData;
lhsData = (((this.data!= null)&&(!this.data.isEmpty()))?this.getData():null);
List rhsData;
rhsData = (((that.data!= null)&&(!that.data.isEmpty()))?that.getData():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "data", lhsData), LocatorUtils.property(thatLocator, "data", rhsData), lhsData, rhsData, ((this.data!= null)&&(!this.data.isEmpty())), ((that.data!= null)&&(!that.data.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);
{
Instant theTimestamp;
theTimestamp = this.getTimestamp();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "timestamp", theTimestamp), currentHashCode, theTimestamp, (this.timestamp!= null));
}
{
Coding theEvent;
theEvent = this.getEvent();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "event", theEvent), currentHashCode, theEvent, (this.event!= null));
}
{
MessageHeaderResponse theResponse;
theResponse = this.getResponse();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "response", theResponse), currentHashCode, theResponse, (this.response!= null));
}
{
MessageHeaderSource theSource;
theSource = this.getSource();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "source", theSource), currentHashCode, theSource, (this.source!= null));
}
{
List theDestination;
theDestination = (((this.destination!= null)&&(!this.destination.isEmpty()))?this.getDestination():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "destination", theDestination), currentHashCode, theDestination, ((this.destination!= null)&&(!this.destination.isEmpty())));
}
{
Reference theEnterer;
theEnterer = this.getEnterer();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "enterer", theEnterer), currentHashCode, theEnterer, (this.enterer!= null));
}
{
Reference theAuthor;
theAuthor = this.getAuthor();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "author", theAuthor), currentHashCode, theAuthor, (this.author!= null));
}
{
Reference theReceiver;
theReceiver = this.getReceiver();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "receiver", theReceiver), currentHashCode, theReceiver, (this.receiver!= null));
}
{
Reference theResponsible;
theResponsible = this.getResponsible();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "responsible", theResponsible), currentHashCode, theResponsible, (this.responsible!= null));
}
{
CodeableConcept theReason;
theReason = this.getReason();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "reason", theReason), currentHashCode, theReason, (this.reason!= null));
}
{
List theData;
theData = (((this.data!= null)&&(!this.data.isEmpty()))?this.getData():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "data", theData), currentHashCode, theData, ((this.data!= null)&&(!this.data.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);
{
Instant theTimestamp;
theTimestamp = this.getTimestamp();
strategy.appendField(locator, this, "timestamp", buffer, theTimestamp, (this.timestamp!= null));
}
{
Coding theEvent;
theEvent = this.getEvent();
strategy.appendField(locator, this, "event", buffer, theEvent, (this.event!= null));
}
{
MessageHeaderResponse theResponse;
theResponse = this.getResponse();
strategy.appendField(locator, this, "response", buffer, theResponse, (this.response!= null));
}
{
MessageHeaderSource theSource;
theSource = this.getSource();
strategy.appendField(locator, this, "source", buffer, theSource, (this.source!= null));
}
{
List theDestination;
theDestination = (((this.destination!= null)&&(!this.destination.isEmpty()))?this.getDestination():null);
strategy.appendField(locator, this, "destination", buffer, theDestination, ((this.destination!= null)&&(!this.destination.isEmpty())));
}
{
Reference theEnterer;
theEnterer = this.getEnterer();
strategy.appendField(locator, this, "enterer", buffer, theEnterer, (this.enterer!= null));
}
{
Reference theAuthor;
theAuthor = this.getAuthor();
strategy.appendField(locator, this, "author", buffer, theAuthor, (this.author!= null));
}
{
Reference theReceiver;
theReceiver = this.getReceiver();
strategy.appendField(locator, this, "receiver", buffer, theReceiver, (this.receiver!= null));
}
{
Reference theResponsible;
theResponsible = this.getResponsible();
strategy.appendField(locator, this, "responsible", buffer, theResponsible, (this.responsible!= null));
}
{
CodeableConcept theReason;
theReason = this.getReason();
strategy.appendField(locator, this, "reason", buffer, theReason, (this.reason!= null));
}
{
List theData;
theData = (((this.data!= null)&&(!this.data.isEmpty()))?this.getData():null);
strategy.appendField(locator, this, "data", buffer, theData, ((this.data!= null)&&(!this.data.isEmpty())));
}
return buffer;
}
public void setDestination(List value) {
this.destination = value;
}
public void setData(List value) {
this.data = value;
}
}