org.somda.sdc.biceps.model.participant.OrderDetail Maven / Gradle / Ivy
Show all versions of biceps-model Show documentation
package org.somda.sdc.biceps.model.participant;
import java.util.ArrayList;
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.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlSeeAlso;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jetbrains.annotations.Nullable;
import org.jvnet.jaxb.lang.CopyStrategy;
import org.jvnet.jaxb.lang.CopyTo;
import org.jvnet.jaxb.lang.JAXBCopyStrategy;
import org.jvnet.jaxb.lang.JAXBToStringStrategy;
import org.jvnet.jaxb.lang.ToString;
import org.jvnet.jaxb.lang.ToStringStrategy;
import org.jvnet.jaxb.locator.ObjectLocator;
import org.jvnet.jaxb.locator.util.LocatorUtils;
import org.somda.sdc.biceps.model.extension.ExtensionType;
import org.somda.sdc.common.model.AnyDateTime;
import org.somda.sdc.common.model.AnyDateTimeAdapter;
/**
* Details of an order that will be performed or that has been performed.
*
* Java class for OrderDetail complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "OrderDetail", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", propOrder = {
"extension",
"start",
"end",
"performer",
"service",
"imagingProcedure"
})
@XmlSeeAlso({
org.somda.sdc.biceps.model.participant.WorkflowContextState.WorkflowDetail.RequestedOrderDetail.class,
org.somda.sdc.biceps.model.participant.WorkflowContextState.WorkflowDetail.PerformedOrderDetail.class
})
public class OrderDetail implements Cloneable, CopyTo, ToString
{
@XmlElement(name = "Extension", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/extension")
protected ExtensionType extension;
/**
* Data for start of requested/performed procedure.
*
*/
@XmlElement(name = "Start", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", type = String.class)
@XmlJavaTypeAdapter(AnyDateTimeAdapter.class)
@XmlSchemaType(name = "dateTime")
protected AnyDateTime start;
/**
* Data for end of requested/performed procedure.
*
*/
@XmlElement(name = "End", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", type = String.class)
@XmlJavaTypeAdapter(AnyDateTimeAdapter.class)
@XmlSchemaType(name = "dateTime")
protected AnyDateTime end;
/**
* Names with roles of attending staff.
*
*/
@XmlElement(name = "Performer", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected List performer;
/**
* Identifier and textual descriptions of requested/performed procedures
*
*/
@XmlElement(name = "Service", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected List service;
/**
* ImagingProcedure provide identifiers used by the DICOM and HL7 standard to identify the requested imaging procedures resulting from an order in a the hospital.
*
*/
@XmlElement(name = "ImagingProcedure", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant")
protected List imagingProcedure;
/**
* Gets the value of the extension property.
*
* @return
* possible object is
* {@link ExtensionType }
*
*/
@Nullable
public ExtensionType getExtension() {
return extension;
}
/**
* Sets the value of the extension property.
*
* @param value
* allowed object is
* {@link ExtensionType }
*
*/
public void setExtension(
@Nullable
ExtensionType value) {
this.extension = value;
}
/**
* Data for start of requested/performed procedure.
*
* @return
* possible object is
* {@link String }
*
*/
@Nullable
public AnyDateTime getStart() {
return start;
}
/**
* Sets the value of the start property.
*
* @param value
* allowed object is
* {@link String }
*
* @see #getStart()
*/
public void setStart(
@Nullable
AnyDateTime value) {
this.start = value;
}
/**
* Data for end of requested/performed procedure.
*
* @return
* possible object is
* {@link String }
*
*/
@Nullable
public AnyDateTime getEnd() {
return end;
}
/**
* Sets the value of the end property.
*
* @param value
* allowed object is
* {@link String }
*
* @see #getEnd()
*/
public void setEnd(
@Nullable
AnyDateTime value) {
this.end = value;
}
/**
* Names with roles of attending staff.
*
* Gets the value of the performer 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 JAXB object.
* This is why there is not a set
method for the performer property.
*
*
* For example, to add a new item, do as follows:
*
*
* getPerformer().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link PersonParticipation }
*
*
*
* @return
* The value of the performer property.
*/
public List getPerformer() {
if (performer == null) {
performer = new ArrayList<>();
}
return this.performer;
}
/**
* Identifier and textual descriptions of requested/performed procedures
*
* Gets the value of the service 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 JAXB object.
* This is why there is not a set
method for the service property.
*
*
* For example, to add a new item, do as follows:
*
*
* getService().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link CodedValue }
*
*
*
* @return
* The value of the service property.
*/
public List getService() {
if (service == null) {
service = new ArrayList<>();
}
return this.service;
}
/**
* ImagingProcedure provide identifiers used by the DICOM and HL7 standard to identify the requested imaging procedures resulting from an order in a the hospital.
*
* Gets the value of the imagingProcedure 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 JAXB object.
* This is why there is not a set
method for the imagingProcedure property.
*
*
* For example, to add a new item, do as follows:
*
*
* getImagingProcedure().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link ImagingProcedure }
*
*
*
* @return
* The value of the imagingProcedure property.
*/
public List getImagingProcedure() {
if (imagingProcedure == null) {
imagingProcedure = new ArrayList<>();
}
return this.imagingProcedure;
}
public void setPerformer(
@Nullable
List value) {
this.performer = null;
if (value!= null) {
List draftl = this.getPerformer();
draftl.addAll(value);
}
}
public void setService(
@Nullable
List value) {
this.service = null;
if (value!= null) {
List draftl = this.getService();
draftl.addAll(value);
}
}
public void setImagingProcedure(
@Nullable
List value) {
this.imagingProcedure = null;
if (value!= null) {
List draftl = this.getImagingProcedure();
draftl.addAll(value);
}
}
@Override
public boolean equals(Object object) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
final OrderDetail that = ((OrderDetail) object);
{
ExtensionType leftExtension;
leftExtension = this.getExtension();
ExtensionType rightExtension;
rightExtension = that.getExtension();
if (this.extension!= null) {
if (that.extension!= null) {
if (!leftExtension.equals(rightExtension)) {
return false;
}
} else {
return false;
}
} else {
if (that.extension!= null) {
return false;
}
}
}
{
AnyDateTime leftStart;
leftStart = this.getStart();
AnyDateTime rightStart;
rightStart = that.getStart();
if (this.start!= null) {
if (that.start!= null) {
if (!leftStart.equals(rightStart)) {
return false;
}
} else {
return false;
}
} else {
if (that.start!= null) {
return false;
}
}
}
{
AnyDateTime leftEnd;
leftEnd = this.getEnd();
AnyDateTime rightEnd;
rightEnd = that.getEnd();
if (this.end!= null) {
if (that.end!= null) {
if (!leftEnd.equals(rightEnd)) {
return false;
}
} else {
return false;
}
} else {
if (that.end!= null) {
return false;
}
}
}
{
List leftPerformer;
leftPerformer = (((this.performer!= null)&&(!this.performer.isEmpty()))?this.getPerformer():null);
List rightPerformer;
rightPerformer = (((that.performer!= null)&&(!that.performer.isEmpty()))?that.getPerformer():null);
if ((this.performer!= null)&&(!this.performer.isEmpty())) {
if ((that.performer!= null)&&(!that.performer.isEmpty())) {
if (!leftPerformer.equals(rightPerformer)) {
return false;
}
} else {
return false;
}
} else {
if ((that.performer!= null)&&(!that.performer.isEmpty())) {
return false;
}
}
}
{
List leftService;
leftService = (((this.service!= null)&&(!this.service.isEmpty()))?this.getService():null);
List rightService;
rightService = (((that.service!= null)&&(!that.service.isEmpty()))?that.getService():null);
if ((this.service!= null)&&(!this.service.isEmpty())) {
if ((that.service!= null)&&(!that.service.isEmpty())) {
if (!leftService.equals(rightService)) {
return false;
}
} else {
return false;
}
} else {
if ((that.service!= null)&&(!that.service.isEmpty())) {
return false;
}
}
}
{
List leftImagingProcedure;
leftImagingProcedure = (((this.imagingProcedure!= null)&&(!this.imagingProcedure.isEmpty()))?this.getImagingProcedure():null);
List rightImagingProcedure;
rightImagingProcedure = (((that.imagingProcedure!= null)&&(!that.imagingProcedure.isEmpty()))?that.getImagingProcedure():null);
if ((this.imagingProcedure!= null)&&(!this.imagingProcedure.isEmpty())) {
if ((that.imagingProcedure!= null)&&(!that.imagingProcedure.isEmpty())) {
if (!leftImagingProcedure.equals(rightImagingProcedure)) {
return false;
}
} else {
return false;
}
} else {
if ((that.imagingProcedure!= null)&&(!that.imagingProcedure.isEmpty())) {
return false;
}
}
}
return true;
}
@Override
public int hashCode() {
int currentHashCode = 1;
{
currentHashCode = (currentHashCode* 31);
ExtensionType theExtension;
theExtension = this.getExtension();
if (this.extension!= null) {
currentHashCode += theExtension.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
AnyDateTime theStart;
theStart = this.getStart();
if (this.start!= null) {
currentHashCode += theStart.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
AnyDateTime theEnd;
theEnd = this.getEnd();
if (this.end!= null) {
currentHashCode += theEnd.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
List thePerformer;
thePerformer = (((this.performer!= null)&&(!this.performer.isEmpty()))?this.getPerformer():null);
if ((this.performer!= null)&&(!this.performer.isEmpty())) {
currentHashCode += thePerformer.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
List theService;
theService = (((this.service!= null)&&(!this.service.isEmpty()))?this.getService():null);
if ((this.service!= null)&&(!this.service.isEmpty())) {
currentHashCode += theService.hashCode();
}
}
{
currentHashCode = (currentHashCode* 31);
List theImagingProcedure;
theImagingProcedure = (((this.imagingProcedure!= null)&&(!this.imagingProcedure.isEmpty()))?this.getImagingProcedure():null);
if ((this.imagingProcedure!= null)&&(!this.imagingProcedure.isEmpty())) {
currentHashCode += theImagingProcedure.hashCode();
}
}
return currentHashCode;
}
@Override
public String toString() {
final ToStringStrategy strategy = JAXBToStringStrategy.getInstance();
final StringBuilder buffer = new StringBuilder();
append(null, buffer, strategy);
return buffer.toString();
}
@Override
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy 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, ToStringStrategy strategy) {
{
ExtensionType theExtension;
theExtension = this.getExtension();
strategy.appendField(locator, this, "extension", buffer, theExtension, (this.extension!= null));
}
{
AnyDateTime theStart;
theStart = this.getStart();
strategy.appendField(locator, this, "start", buffer, theStart, (this.start!= null));
}
{
AnyDateTime theEnd;
theEnd = this.getEnd();
strategy.appendField(locator, this, "end", buffer, theEnd, (this.end!= null));
}
{
List thePerformer;
thePerformer = (((this.performer!= null)&&(!this.performer.isEmpty()))?this.getPerformer():null);
strategy.appendField(locator, this, "performer", buffer, thePerformer, ((this.performer!= null)&&(!this.performer.isEmpty())));
}
{
List theService;
theService = (((this.service!= null)&&(!this.service.isEmpty()))?this.getService():null);
strategy.appendField(locator, this, "service", buffer, theService, ((this.service!= null)&&(!this.service.isEmpty())));
}
{
List theImagingProcedure;
theImagingProcedure = (((this.imagingProcedure!= null)&&(!this.imagingProcedure.isEmpty()))?this.getImagingProcedure():null);
strategy.appendField(locator, this, "imagingProcedure", buffer, theImagingProcedure, ((this.imagingProcedure!= null)&&(!this.imagingProcedure.isEmpty())));
}
return buffer;
}
@Override
public Object clone() {
return copyTo(createNewInstance());
}
@Override
public Object copyTo(Object target) {
final CopyStrategy strategy = JAXBCopyStrategy.getInstance();
return copyTo(null, target, strategy);
}
@Override
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy strategy) {
final Object draftCopy = ((target == null)?createNewInstance():target);
if (draftCopy instanceof OrderDetail) {
final OrderDetail copy = ((OrderDetail) draftCopy);
{
Boolean extensionShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.extension!= null));
if (extensionShouldBeCopiedAndSet == Boolean.TRUE) {
ExtensionType sourceExtension;
sourceExtension = this.getExtension();
ExtensionType copyExtension = ((ExtensionType) strategy.copy(LocatorUtils.property(locator, "extension", sourceExtension), sourceExtension, (this.extension!= null)));
copy.setExtension(copyExtension);
} else {
if (extensionShouldBeCopiedAndSet == Boolean.FALSE) {
copy.extension = null;
}
}
}
{
Boolean startShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.start!= null));
if (startShouldBeCopiedAndSet == Boolean.TRUE) {
AnyDateTime sourceStart;
sourceStart = this.getStart();
AnyDateTime copyStart = ((AnyDateTime) strategy.copy(LocatorUtils.property(locator, "start", sourceStart), sourceStart, (this.start!= null)));
copy.setStart(copyStart);
} else {
if (startShouldBeCopiedAndSet == Boolean.FALSE) {
copy.start = null;
}
}
}
{
Boolean endShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.end!= null));
if (endShouldBeCopiedAndSet == Boolean.TRUE) {
AnyDateTime sourceEnd;
sourceEnd = this.getEnd();
AnyDateTime copyEnd = ((AnyDateTime) strategy.copy(LocatorUtils.property(locator, "end", sourceEnd), sourceEnd, (this.end!= null)));
copy.setEnd(copyEnd);
} else {
if (endShouldBeCopiedAndSet == Boolean.FALSE) {
copy.end = null;
}
}
}
{
Boolean performerShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.performer!= null)&&(!this.performer.isEmpty())));
if (performerShouldBeCopiedAndSet == Boolean.TRUE) {
List sourcePerformer;
sourcePerformer = (((this.performer!= null)&&(!this.performer.isEmpty()))?this.getPerformer():null);
@SuppressWarnings("unchecked")
List copyPerformer = ((List ) strategy.copy(LocatorUtils.property(locator, "performer", sourcePerformer), sourcePerformer, ((this.performer!= null)&&(!this.performer.isEmpty()))));
copy.setPerformer(copyPerformer);
} else {
if (performerShouldBeCopiedAndSet == Boolean.FALSE) {
copy.performer = null;
}
}
}
{
Boolean serviceShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.service!= null)&&(!this.service.isEmpty())));
if (serviceShouldBeCopiedAndSet == Boolean.TRUE) {
List sourceService;
sourceService = (((this.service!= null)&&(!this.service.isEmpty()))?this.getService():null);
@SuppressWarnings("unchecked")
List copyService = ((List ) strategy.copy(LocatorUtils.property(locator, "service", sourceService), sourceService, ((this.service!= null)&&(!this.service.isEmpty()))));
copy.setService(copyService);
} else {
if (serviceShouldBeCopiedAndSet == Boolean.FALSE) {
copy.service = null;
}
}
}
{
Boolean imagingProcedureShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.imagingProcedure!= null)&&(!this.imagingProcedure.isEmpty())));
if (imagingProcedureShouldBeCopiedAndSet == Boolean.TRUE) {
List sourceImagingProcedure;
sourceImagingProcedure = (((this.imagingProcedure!= null)&&(!this.imagingProcedure.isEmpty()))?this.getImagingProcedure():null);
@SuppressWarnings("unchecked")
List copyImagingProcedure = ((List ) strategy.copy(LocatorUtils.property(locator, "imagingProcedure", sourceImagingProcedure), sourceImagingProcedure, ((this.imagingProcedure!= null)&&(!this.imagingProcedure.isEmpty()))));
copy.setImagingProcedure(copyImagingProcedure);
} else {
if (imagingProcedureShouldBeCopiedAndSet == Boolean.FALSE) {
copy.imagingProcedure = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new OrderDetail();
}
}