All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hl7.fhir.Medication Maven / Gradle / Ivy

Go to download

The quick library for the Clinical Quality Language Java reference implementation

There is a newer version: 3.18.0
Show newest version
//
// 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: 2023.12.06 at 03:09:41 PM MST 
//


package org.hl7.fhir;

import java.util.Collection;
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 Medication complex type. * *

The following schema fragment specifies the expected content contained within this class. * *

 * <complexType name="Medication">
 *   <complexContent>
 *     <extension base="{http://hl7.org/fhir}DomainResource">
 *       <sequence>
 *         <element name="code" type="{http://hl7.org/fhir}CodeableConcept" minOccurs="0"/>
 *         <element name="isBrand" type="{http://hl7.org/fhir}boolean" minOccurs="0"/>
 *         <element name="manufacturer" type="{http://hl7.org/fhir}Reference" minOccurs="0"/>
 *         <element name="product" type="{http://hl7.org/fhir}Medication.Product" minOccurs="0"/>
 *         <element name="package" type="{http://hl7.org/fhir}Medication.Package" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Medication", propOrder = { "code", "isBrand", "manufacturer", "product", "_package" }) public class Medication extends DomainResource implements Equals2, HashCode2, ToString2 { protected CodeableConcept code; protected Boolean isBrand; protected Reference manufacturer; protected MedicationProduct product; @XmlElement(name = "package") protected MedicationPackage _package; /** * Gets the value of the code property. * * @return * possible object is * {@link CodeableConcept } * */ public CodeableConcept getCode() { return code; } /** * Sets the value of the code property. * * @param value * allowed object is * {@link CodeableConcept } * */ public void setCode(CodeableConcept value) { this.code = value; } /** * Gets the value of the isBrand property. * * @return * possible object is * {@link Boolean } * */ public Boolean getIsBrand() { return isBrand; } /** * Sets the value of the isBrand property. * * @param value * allowed object is * {@link Boolean } * */ public void setIsBrand(Boolean value) { this.isBrand = value; } /** * Gets the value of the manufacturer property. * * @return * possible object is * {@link Reference } * */ public Reference getManufacturer() { return manufacturer; } /** * Sets the value of the manufacturer property. * * @param value * allowed object is * {@link Reference } * */ public void setManufacturer(Reference value) { this.manufacturer = value; } /** * Gets the value of the product property. * * @return * possible object is * {@link MedicationProduct } * */ public MedicationProduct getProduct() { return product; } /** * Sets the value of the product property. * * @param value * allowed object is * {@link MedicationProduct } * */ public void setProduct(MedicationProduct value) { this.product = value; } /** * Gets the value of the package property. * * @return * possible object is * {@link MedicationPackage } * */ public MedicationPackage getPackage() { return _package; } /** * Sets the value of the package property. * * @param value * allowed object is * {@link MedicationPackage } * */ public void setPackage(MedicationPackage value) { this._package = value; } public Medication withCode(CodeableConcept value) { setCode(value); return this; } public Medication withIsBrand(Boolean value) { setIsBrand(value); return this; } public Medication withManufacturer(Reference value) { setManufacturer(value); return this; } public Medication withProduct(MedicationProduct value) { setProduct(value); return this; } public Medication withPackage(MedicationPackage value) { setPackage(value); return this; } @Override public Medication withText(Narrative value) { setText(value); return this; } @Override public Medication withContained(ResourceContainer... values) { if (values!= null) { for (ResourceContainer value: values) { getContained().add(value); } } return this; } @Override public Medication withContained(Collection values) { if (values!= null) { getContained().addAll(values); } return this; } @Override public Medication withExtension(Extension... values) { if (values!= null) { for (Extension value: values) { getExtension().add(value); } } return this; } @Override public Medication withExtension(Collection values) { if (values!= null) { getExtension().addAll(values); } return this; } @Override public Medication withModifierExtension(Extension... values) { if (values!= null) { for (Extension value: values) { getModifierExtension().add(value); } } return this; } @Override public Medication withModifierExtension(Collection values) { if (values!= null) { getModifierExtension().addAll(values); } return this; } @Override public Medication withId(Id value) { setId(value); return this; } @Override public Medication withMeta(Meta value) { setMeta(value); return this; } @Override public Medication withImplicitRules(Uri value) { setImplicitRules(value); return this; } @Override public Medication 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 Medication that = ((Medication) object); { CodeableConcept lhsCode; lhsCode = this.getCode(); CodeableConcept rhsCode; rhsCode = that.getCode(); if (!strategy.equals(LocatorUtils.property(thisLocator, "code", lhsCode), LocatorUtils.property(thatLocator, "code", rhsCode), lhsCode, rhsCode, (this.code!= null), (that.code!= null))) { return false; } } { Boolean lhsIsBrand; lhsIsBrand = this.getIsBrand(); Boolean rhsIsBrand; rhsIsBrand = that.getIsBrand(); if (!strategy.equals(LocatorUtils.property(thisLocator, "isBrand", lhsIsBrand), LocatorUtils.property(thatLocator, "isBrand", rhsIsBrand), lhsIsBrand, rhsIsBrand, (this.isBrand!= null), (that.isBrand!= null))) { return false; } } { Reference lhsManufacturer; lhsManufacturer = this.getManufacturer(); Reference rhsManufacturer; rhsManufacturer = that.getManufacturer(); if (!strategy.equals(LocatorUtils.property(thisLocator, "manufacturer", lhsManufacturer), LocatorUtils.property(thatLocator, "manufacturer", rhsManufacturer), lhsManufacturer, rhsManufacturer, (this.manufacturer!= null), (that.manufacturer!= null))) { return false; } } { MedicationProduct lhsProduct; lhsProduct = this.getProduct(); MedicationProduct rhsProduct; rhsProduct = that.getProduct(); if (!strategy.equals(LocatorUtils.property(thisLocator, "product", lhsProduct), LocatorUtils.property(thatLocator, "product", rhsProduct), lhsProduct, rhsProduct, (this.product!= null), (that.product!= null))) { return false; } } { MedicationPackage lhsPackage; lhsPackage = this.getPackage(); MedicationPackage rhsPackage; rhsPackage = that.getPackage(); if (!strategy.equals(LocatorUtils.property(thisLocator, "_package", lhsPackage), LocatorUtils.property(thatLocator, "_package", rhsPackage), lhsPackage, rhsPackage, (this._package!= null), (that._package!= null))) { 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); { CodeableConcept theCode; theCode = this.getCode(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "code", theCode), currentHashCode, theCode, (this.code!= null)); } { Boolean theIsBrand; theIsBrand = this.getIsBrand(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isBrand", theIsBrand), currentHashCode, theIsBrand, (this.isBrand!= null)); } { Reference theManufacturer; theManufacturer = this.getManufacturer(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "manufacturer", theManufacturer), currentHashCode, theManufacturer, (this.manufacturer!= null)); } { MedicationProduct theProduct; theProduct = this.getProduct(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "product", theProduct), currentHashCode, theProduct, (this.product!= null)); } { MedicationPackage thePackage; thePackage = this.getPackage(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "_package", thePackage), currentHashCode, thePackage, (this._package!= null)); } 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); { CodeableConcept theCode; theCode = this.getCode(); strategy.appendField(locator, this, "code", buffer, theCode, (this.code!= null)); } { Boolean theIsBrand; theIsBrand = this.getIsBrand(); strategy.appendField(locator, this, "isBrand", buffer, theIsBrand, (this.isBrand!= null)); } { Reference theManufacturer; theManufacturer = this.getManufacturer(); strategy.appendField(locator, this, "manufacturer", buffer, theManufacturer, (this.manufacturer!= null)); } { MedicationProduct theProduct; theProduct = this.getProduct(); strategy.appendField(locator, this, "product", buffer, theProduct, (this.product!= null)); } { MedicationPackage thePackage; thePackage = this.getPackage(); strategy.appendField(locator, this, "_package", buffer, thePackage, (this._package!= null)); } return buffer; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy