org.hl7.fhir.VisionPrescription 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.09.27 at 11:16:19 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.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 VisionPrescription complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="VisionPrescription">
* <complexContent>
* <extension base="{http://hl7.org/fhir}DomainResource">
* <sequence>
* <element name="identifier" type="{http://hl7.org/fhir}Identifier" maxOccurs="unbounded" minOccurs="0"/>
* <element name="dateWritten" type="{http://hl7.org/fhir}dateTime" minOccurs="0"/>
* <element name="patient" type="{http://hl7.org/fhir}Reference" minOccurs="0"/>
* <element name="prescriber" type="{http://hl7.org/fhir}Reference" minOccurs="0"/>
* <element name="encounter" type="{http://hl7.org/fhir}Reference" minOccurs="0"/>
* <choice minOccurs="0">
* <element name="reasonCodeableConcept" type="{http://hl7.org/fhir}CodeableConcept"/>
* <element name="reasonReference" type="{http://hl7.org/fhir}Reference"/>
* </choice>
* <element name="dispense" type="{http://hl7.org/fhir}VisionPrescription.Dispense" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VisionPrescription", propOrder = {
"identifier",
"dateWritten",
"patient",
"prescriber",
"encounter",
"reasonCodeableConcept",
"reasonReference",
"dispense"
})
public class VisionPrescription
extends DomainResource
implements Equals2, HashCode2, ToString2
{
protected List identifier;
protected DateTime dateWritten;
protected Reference patient;
protected Reference prescriber;
protected Reference encounter;
protected CodeableConcept reasonCodeableConcept;
protected Reference reasonReference;
protected List dispense;
/**
* 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 dateWritten property.
*
* @return
* possible object is
* {@link DateTime }
*
*/
public DateTime getDateWritten() {
return dateWritten;
}
/**
* Sets the value of the dateWritten property.
*
* @param value
* allowed object is
* {@link DateTime }
*
*/
public void setDateWritten(DateTime value) {
this.dateWritten = value;
}
/**
* Gets the value of the patient property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getPatient() {
return patient;
}
/**
* Sets the value of the patient property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setPatient(Reference value) {
this.patient = value;
}
/**
* Gets the value of the prescriber property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getPrescriber() {
return prescriber;
}
/**
* Sets the value of the prescriber property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setPrescriber(Reference value) {
this.prescriber = value;
}
/**
* Gets the value of the encounter property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getEncounter() {
return encounter;
}
/**
* Sets the value of the encounter property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setEncounter(Reference value) {
this.encounter = value;
}
/**
* Gets the value of the reasonCodeableConcept property.
*
* @return
* possible object is
* {@link CodeableConcept }
*
*/
public CodeableConcept getReasonCodeableConcept() {
return reasonCodeableConcept;
}
/**
* Sets the value of the reasonCodeableConcept property.
*
* @param value
* allowed object is
* {@link CodeableConcept }
*
*/
public void setReasonCodeableConcept(CodeableConcept value) {
this.reasonCodeableConcept = value;
}
/**
* Gets the value of the reasonReference property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getReasonReference() {
return reasonReference;
}
/**
* Sets the value of the reasonReference property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setReasonReference(Reference value) {
this.reasonReference = value;
}
/**
* Gets the value of the dispense 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 dispense property.
*
*
* For example, to add a new item, do as follows:
*
* getDispense().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link VisionPrescriptionDispense }
*
*
*/
public List getDispense() {
if (dispense == null) {
dispense = new ArrayList();
}
return this.dispense;
}
public VisionPrescription withIdentifier(Identifier... values) {
if (values!= null) {
for (Identifier value: values) {
getIdentifier().add(value);
}
}
return this;
}
public VisionPrescription withIdentifier(Collection values) {
if (values!= null) {
getIdentifier().addAll(values);
}
return this;
}
public VisionPrescription withDateWritten(DateTime value) {
setDateWritten(value);
return this;
}
public VisionPrescription withPatient(Reference value) {
setPatient(value);
return this;
}
public VisionPrescription withPrescriber(Reference value) {
setPrescriber(value);
return this;
}
public VisionPrescription withEncounter(Reference value) {
setEncounter(value);
return this;
}
public VisionPrescription withReasonCodeableConcept(CodeableConcept value) {
setReasonCodeableConcept(value);
return this;
}
public VisionPrescription withReasonReference(Reference value) {
setReasonReference(value);
return this;
}
public VisionPrescription withDispense(VisionPrescriptionDispense... values) {
if (values!= null) {
for (VisionPrescriptionDispense value: values) {
getDispense().add(value);
}
}
return this;
}
public VisionPrescription withDispense(Collection values) {
if (values!= null) {
getDispense().addAll(values);
}
return this;
}
@Override
public VisionPrescription withText(Narrative value) {
setText(value);
return this;
}
@Override
public VisionPrescription withContained(ResourceContainer... values) {
if (values!= null) {
for (ResourceContainer value: values) {
getContained().add(value);
}
}
return this;
}
@Override
public VisionPrescription withContained(Collection values) {
if (values!= null) {
getContained().addAll(values);
}
return this;
}
@Override
public VisionPrescription withExtension(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getExtension().add(value);
}
}
return this;
}
@Override
public VisionPrescription withExtension(Collection values) {
if (values!= null) {
getExtension().addAll(values);
}
return this;
}
@Override
public VisionPrescription withModifierExtension(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getModifierExtension().add(value);
}
}
return this;
}
@Override
public VisionPrescription withModifierExtension(Collection values) {
if (values!= null) {
getModifierExtension().addAll(values);
}
return this;
}
@Override
public VisionPrescription withId(Id value) {
setId(value);
return this;
}
@Override
public VisionPrescription withMeta(Meta value) {
setMeta(value);
return this;
}
@Override
public VisionPrescription withImplicitRules(Uri value) {
setImplicitRules(value);
return this;
}
@Override
public VisionPrescription 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 VisionPrescription that = ((VisionPrescription) 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;
}
}
{
DateTime lhsDateWritten;
lhsDateWritten = this.getDateWritten();
DateTime rhsDateWritten;
rhsDateWritten = that.getDateWritten();
if (!strategy.equals(LocatorUtils.property(thisLocator, "dateWritten", lhsDateWritten), LocatorUtils.property(thatLocator, "dateWritten", rhsDateWritten), lhsDateWritten, rhsDateWritten, (this.dateWritten!= null), (that.dateWritten!= null))) {
return false;
}
}
{
Reference lhsPatient;
lhsPatient = this.getPatient();
Reference rhsPatient;
rhsPatient = that.getPatient();
if (!strategy.equals(LocatorUtils.property(thisLocator, "patient", lhsPatient), LocatorUtils.property(thatLocator, "patient", rhsPatient), lhsPatient, rhsPatient, (this.patient!= null), (that.patient!= null))) {
return false;
}
}
{
Reference lhsPrescriber;
lhsPrescriber = this.getPrescriber();
Reference rhsPrescriber;
rhsPrescriber = that.getPrescriber();
if (!strategy.equals(LocatorUtils.property(thisLocator, "prescriber", lhsPrescriber), LocatorUtils.property(thatLocator, "prescriber", rhsPrescriber), lhsPrescriber, rhsPrescriber, (this.prescriber!= null), (that.prescriber!= null))) {
return false;
}
}
{
Reference lhsEncounter;
lhsEncounter = this.getEncounter();
Reference rhsEncounter;
rhsEncounter = that.getEncounter();
if (!strategy.equals(LocatorUtils.property(thisLocator, "encounter", lhsEncounter), LocatorUtils.property(thatLocator, "encounter", rhsEncounter), lhsEncounter, rhsEncounter, (this.encounter!= null), (that.encounter!= null))) {
return false;
}
}
{
CodeableConcept lhsReasonCodeableConcept;
lhsReasonCodeableConcept = this.getReasonCodeableConcept();
CodeableConcept rhsReasonCodeableConcept;
rhsReasonCodeableConcept = that.getReasonCodeableConcept();
if (!strategy.equals(LocatorUtils.property(thisLocator, "reasonCodeableConcept", lhsReasonCodeableConcept), LocatorUtils.property(thatLocator, "reasonCodeableConcept", rhsReasonCodeableConcept), lhsReasonCodeableConcept, rhsReasonCodeableConcept, (this.reasonCodeableConcept!= null), (that.reasonCodeableConcept!= null))) {
return false;
}
}
{
Reference lhsReasonReference;
lhsReasonReference = this.getReasonReference();
Reference rhsReasonReference;
rhsReasonReference = that.getReasonReference();
if (!strategy.equals(LocatorUtils.property(thisLocator, "reasonReference", lhsReasonReference), LocatorUtils.property(thatLocator, "reasonReference", rhsReasonReference), lhsReasonReference, rhsReasonReference, (this.reasonReference!= null), (that.reasonReference!= null))) {
return false;
}
}
{
List lhsDispense;
lhsDispense = (((this.dispense!= null)&&(!this.dispense.isEmpty()))?this.getDispense():null);
List rhsDispense;
rhsDispense = (((that.dispense!= null)&&(!that.dispense.isEmpty()))?that.getDispense():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "dispense", lhsDispense), LocatorUtils.property(thatLocator, "dispense", rhsDispense), lhsDispense, rhsDispense, ((this.dispense!= null)&&(!this.dispense.isEmpty())), ((that.dispense!= null)&&(!that.dispense.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())));
}
{
DateTime theDateWritten;
theDateWritten = this.getDateWritten();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "dateWritten", theDateWritten), currentHashCode, theDateWritten, (this.dateWritten!= null));
}
{
Reference thePatient;
thePatient = this.getPatient();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "patient", thePatient), currentHashCode, thePatient, (this.patient!= null));
}
{
Reference thePrescriber;
thePrescriber = this.getPrescriber();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "prescriber", thePrescriber), currentHashCode, thePrescriber, (this.prescriber!= null));
}
{
Reference theEncounter;
theEncounter = this.getEncounter();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "encounter", theEncounter), currentHashCode, theEncounter, (this.encounter!= null));
}
{
CodeableConcept theReasonCodeableConcept;
theReasonCodeableConcept = this.getReasonCodeableConcept();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "reasonCodeableConcept", theReasonCodeableConcept), currentHashCode, theReasonCodeableConcept, (this.reasonCodeableConcept!= null));
}
{
Reference theReasonReference;
theReasonReference = this.getReasonReference();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "reasonReference", theReasonReference), currentHashCode, theReasonReference, (this.reasonReference!= null));
}
{
List theDispense;
theDispense = (((this.dispense!= null)&&(!this.dispense.isEmpty()))?this.getDispense():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "dispense", theDispense), currentHashCode, theDispense, ((this.dispense!= null)&&(!this.dispense.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())));
}
{
DateTime theDateWritten;
theDateWritten = this.getDateWritten();
strategy.appendField(locator, this, "dateWritten", buffer, theDateWritten, (this.dateWritten!= null));
}
{
Reference thePatient;
thePatient = this.getPatient();
strategy.appendField(locator, this, "patient", buffer, thePatient, (this.patient!= null));
}
{
Reference thePrescriber;
thePrescriber = this.getPrescriber();
strategy.appendField(locator, this, "prescriber", buffer, thePrescriber, (this.prescriber!= null));
}
{
Reference theEncounter;
theEncounter = this.getEncounter();
strategy.appendField(locator, this, "encounter", buffer, theEncounter, (this.encounter!= null));
}
{
CodeableConcept theReasonCodeableConcept;
theReasonCodeableConcept = this.getReasonCodeableConcept();
strategy.appendField(locator, this, "reasonCodeableConcept", buffer, theReasonCodeableConcept, (this.reasonCodeableConcept!= null));
}
{
Reference theReasonReference;
theReasonReference = this.getReasonReference();
strategy.appendField(locator, this, "reasonReference", buffer, theReasonReference, (this.reasonReference!= null));
}
{
List theDispense;
theDispense = (((this.dispense!= null)&&(!this.dispense.isEmpty()))?this.getDispense():null);
strategy.appendField(locator, this, "dispense", buffer, theDispense, ((this.dispense!= null)&&(!this.dispense.isEmpty())));
}
return buffer;
}
public void setIdentifier(List value) {
this.identifier = value;
}
public void setDispense(List value) {
this.dispense = value;
}
}