/**
 * COCTMT080000UVContainer.java
 * <p>
 * File generated from the coctmt080000UV::COCTMT080000UVContainer uml Class
 * Generated by IHE - europe, gazelle team
 */
package net.ihe.gazelle.hl7v3.coctmt080000UV;

import java.io.Serial;
import java.util.ArrayList;
import java.util.List;

import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlTransient;
import jakarta.xml.bind.annotation.XmlType;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import net.ihe.gazelle.gen.common.ConstraintValidatorModule;

import org.w3c.dom.Document;
import org.w3c.dom.Node;


/**
 * Description of the class COCTMT080000UVContainer.
 *
 */

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "COCT_MT080000UV.Container", propOrder = {
	"realmCode",
	"typeId",
	"templateId",
	"id",
	"code",
	"desc",
	"riskCode",
	"handlingCode",
	"capacityQuantity",
	"heightQuantity",
	"diameterQuantity",
	"capTypeCode",
	"separatorTypeCode",
	"barrierDeltaQuantity",
	"bottomDeltaQuantity",
	"asIdentifiedContainer",
	"asContent",
	"asLocatedEntity",
	"additive",
	"classCode",
	"determinerCode",
	"nullFlavor"
})
@XmlRootElement(name = "COCT_MT080000UV.Container")
public class COCTMT080000UVContainer implements java.io.Serializable {
	
	/**
	 * 
	 */
	@Serial
    private static final long serialVersionUID = 1L;

	
	@XmlElement(name = "realmCode", namespace = "urn:hl7-org:v3")
	public List<net.ihe.gazelle.hl7v3.datatypes.CS> realmCode;
	@XmlElement(name = "typeId", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.II typeId;
	@XmlElement(name = "templateId", namespace = "urn:hl7-org:v3")
	public List<net.ihe.gazelle.hl7v3.datatypes.II> templateId;
	@XmlElement(name = "id", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.II id;
	@XmlElement(name = "code", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.CE code;
	@XmlElement(name = "desc", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.ED desc;
	@XmlElement(name = "riskCode", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.CE riskCode;
	@XmlElement(name = "handlingCode", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.CE handlingCode;
	@XmlElement(name = "capacityQuantity", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.PQ capacityQuantity;
	@XmlElement(name = "heightQuantity", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.PQ heightQuantity;
	@XmlElement(name = "diameterQuantity", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.PQ diameterQuantity;
	@XmlElement(name = "capTypeCode", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.CE capTypeCode;
	@XmlElement(name = "separatorTypeCode", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.CE separatorTypeCode;
	@XmlElement(name = "barrierDeltaQuantity", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.PQ barrierDeltaQuantity;
	@XmlElement(name = "bottomDeltaQuantity", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.PQ bottomDeltaQuantity;
	@XmlElement(name = "asIdentifiedContainer", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVIdentifiedContainer asIdentifiedContainer;
	@XmlElement(name = "asContent", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVContent3 asContent;
	@XmlElement(name = "asLocatedEntity", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.coctmt070000UV01.COCTMT070000UV01LocatedEntity asLocatedEntity;
	@XmlElement(name = "additive", namespace = "urn:hl7-org:v3")
	public List<net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVAdditive2> additive;
	@XmlAttribute(name = "classCode", required = true)
	public net.ihe.gazelle.hl7v3.voc.EntityClassContainer classCode;
	@XmlAttribute(name = "determinerCode", required = true)
	public net.ihe.gazelle.hl7v3.voc.EntityDeterminer determinerCode;
	@XmlAttribute(name = "nullFlavor")
	public net.ihe.gazelle.hl7v3.voc.NullFlavor nullFlavor;
	
	/**
	 * An attribute containing marshalled element node
	 */
	@XmlTransient
	private org.w3c.dom.Node _xmlNodePresentation;
	
	
	/**
	 * Return realmCode.
	 * @return realmCode
	 */
	public List<net.ihe.gazelle.hl7v3.datatypes.CS> getRealmCode() {
		if (realmCode == null) {
	        realmCode = new ArrayList<>();
	    }
	    return realmCode;
	}
	
	/**
	 * Set a value to attribute realmCode.
     */
	public void setRealmCode(List<net.ihe.gazelle.hl7v3.datatypes.CS> realmCode) {
	    this.realmCode = realmCode;
	}
	
	
	
	/**
	 * Add a realmCode to the realmCode collection.
	 * @param realmCode_elt Element to add.
	 */
	public void addRealmCode(net.ihe.gazelle.hl7v3.datatypes.CS realmCode_elt) {
	    this.realmCode.add(realmCode_elt);
	}
	
	/**
	 * Remove a realmCode to the realmCode collection.
	 * @param realmCode_elt Element to remove
	 */
	public void removeRealmCode(net.ihe.gazelle.hl7v3.datatypes.CS realmCode_elt) {
	    this.realmCode.remove(realmCode_elt);
	}
	
	/**
	 * Return typeId.
	 * @return typeId
	 */
	public net.ihe.gazelle.hl7v3.datatypes.II getTypeId() {
	    return typeId;
	}
	
	/**
	 * Set a value to attribute typeId.
     */
	public void setTypeId(net.ihe.gazelle.hl7v3.datatypes.II typeId) {
	    this.typeId = typeId;
	}
	
	
	
	
	/**
	 * Return templateId.
	 * @return templateId
	 */
	public List<net.ihe.gazelle.hl7v3.datatypes.II> getTemplateId() {
		if (templateId == null) {
	        templateId = new ArrayList<>();
	    }
	    return templateId;
	}
	
	/**
	 * Set a value to attribute templateId.
     */
	public void setTemplateId(List<net.ihe.gazelle.hl7v3.datatypes.II> templateId) {
	    this.templateId = templateId;
	}
	
	
	
	/**
	 * Add a templateId to the templateId collection.
	 * @param templateId_elt Element to add.
	 */
	public void addTemplateId(net.ihe.gazelle.hl7v3.datatypes.II templateId_elt) {
	    this.templateId.add(templateId_elt);
	}
	
	/**
	 * Remove a templateId to the templateId collection.
	 * @param templateId_elt Element to remove
	 */
	public void removeTemplateId(net.ihe.gazelle.hl7v3.datatypes.II templateId_elt) {
	    this.templateId.remove(templateId_elt);
	}
	
	/**
	 * Return id.
	 * @return id
	 */
	public net.ihe.gazelle.hl7v3.datatypes.II getId() {
	    return id;
	}
	
	/**
	 * Set a value to attribute id.
     */
	public void setId(net.ihe.gazelle.hl7v3.datatypes.II id) {
	    this.id = id;
	}
	
	
	
	
	/**
	 * Return code.
	 * @return code
	 */
	public net.ihe.gazelle.hl7v3.datatypes.CE getCode() {
	    return code;
	}
	
	/**
	 * Set a value to attribute code.
     */
	public void setCode(net.ihe.gazelle.hl7v3.datatypes.CE code) {
	    this.code = code;
	}
	
	
	
	
	/**
	 * Return desc.
	 * @return desc
	 */
	public net.ihe.gazelle.hl7v3.datatypes.ED getDesc() {
	    return desc;
	}
	
	/**
	 * Set a value to attribute desc.
     */
	public void setDesc(net.ihe.gazelle.hl7v3.datatypes.ED desc) {
	    this.desc = desc;
	}
	
	
	
	
	/**
	 * Return riskCode.
	 * @return riskCode
	 */
	public net.ihe.gazelle.hl7v3.datatypes.CE getRiskCode() {
	    return riskCode;
	}
	
	/**
	 * Set a value to attribute riskCode.
     */
	public void setRiskCode(net.ihe.gazelle.hl7v3.datatypes.CE riskCode) {
	    this.riskCode = riskCode;
	}
	
	
	
	
	/**
	 * Return handlingCode.
	 * @return handlingCode
	 */
	public net.ihe.gazelle.hl7v3.datatypes.CE getHandlingCode() {
	    return handlingCode;
	}
	
	/**
	 * Set a value to attribute handlingCode.
     */
	public void setHandlingCode(net.ihe.gazelle.hl7v3.datatypes.CE handlingCode) {
	    this.handlingCode = handlingCode;
	}
	
	
	
	
	/**
	 * Return capacityQuantity.
	 * @return capacityQuantity
	 */
	public net.ihe.gazelle.hl7v3.datatypes.PQ getCapacityQuantity() {
	    return capacityQuantity;
	}
	
	/**
	 * Set a value to attribute capacityQuantity.
     */
	public void setCapacityQuantity(net.ihe.gazelle.hl7v3.datatypes.PQ capacityQuantity) {
	    this.capacityQuantity = capacityQuantity;
	}
	
	
	
	
	/**
	 * Return heightQuantity.
	 * @return heightQuantity
	 */
	public net.ihe.gazelle.hl7v3.datatypes.PQ getHeightQuantity() {
	    return heightQuantity;
	}
	
	/**
	 * Set a value to attribute heightQuantity.
     */
	public void setHeightQuantity(net.ihe.gazelle.hl7v3.datatypes.PQ heightQuantity) {
	    this.heightQuantity = heightQuantity;
	}
	
	
	
	
	/**
	 * Return diameterQuantity.
	 * @return diameterQuantity
	 */
	public net.ihe.gazelle.hl7v3.datatypes.PQ getDiameterQuantity() {
	    return diameterQuantity;
	}
	
	/**
	 * Set a value to attribute diameterQuantity.
     */
	public void setDiameterQuantity(net.ihe.gazelle.hl7v3.datatypes.PQ diameterQuantity) {
	    this.diameterQuantity = diameterQuantity;
	}
	
	
	
	
	/**
	 * Return capTypeCode.
	 * @return capTypeCode
	 */
	public net.ihe.gazelle.hl7v3.datatypes.CE getCapTypeCode() {
	    return capTypeCode;
	}
	
	/**
	 * Set a value to attribute capTypeCode.
     */
	public void setCapTypeCode(net.ihe.gazelle.hl7v3.datatypes.CE capTypeCode) {
	    this.capTypeCode = capTypeCode;
	}
	
	
	
	
	/**
	 * Return separatorTypeCode.
	 * @return separatorTypeCode
	 */
	public net.ihe.gazelle.hl7v3.datatypes.CE getSeparatorTypeCode() {
	    return separatorTypeCode;
	}
	
	/**
	 * Set a value to attribute separatorTypeCode.
     */
	public void setSeparatorTypeCode(net.ihe.gazelle.hl7v3.datatypes.CE separatorTypeCode) {
	    this.separatorTypeCode = separatorTypeCode;
	}
	
	
	
	
	/**
	 * Return barrierDeltaQuantity.
	 * @return barrierDeltaQuantity
	 */
	public net.ihe.gazelle.hl7v3.datatypes.PQ getBarrierDeltaQuantity() {
	    return barrierDeltaQuantity;
	}
	
	/**
	 * Set a value to attribute barrierDeltaQuantity.
     */
	public void setBarrierDeltaQuantity(net.ihe.gazelle.hl7v3.datatypes.PQ barrierDeltaQuantity) {
	    this.barrierDeltaQuantity = barrierDeltaQuantity;
	}
	
	
	
	
	/**
	 * Return bottomDeltaQuantity.
	 * @return bottomDeltaQuantity
	 */
	public net.ihe.gazelle.hl7v3.datatypes.PQ getBottomDeltaQuantity() {
	    return bottomDeltaQuantity;
	}
	
	/**
	 * Set a value to attribute bottomDeltaQuantity.
     */
	public void setBottomDeltaQuantity(net.ihe.gazelle.hl7v3.datatypes.PQ bottomDeltaQuantity) {
	    this.bottomDeltaQuantity = bottomDeltaQuantity;
	}
	
	
	
	
	/**
	 * Return asIdentifiedContainer.
	 * @return asIdentifiedContainer
	 */
	public net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVIdentifiedContainer getAsIdentifiedContainer() {
	    return asIdentifiedContainer;
	}
	
	/**
	 * Set a value to attribute asIdentifiedContainer.
     */
	public void setAsIdentifiedContainer(net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVIdentifiedContainer asIdentifiedContainer) {
	    this.asIdentifiedContainer = asIdentifiedContainer;
	}
	
	
	
	
	/**
	 * Return asContent.
	 * @return asContent
	 */
	public net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVContent3 getAsContent() {
	    return asContent;
	}
	
	/**
	 * Set a value to attribute asContent.
     */
	public void setAsContent(net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVContent3 asContent) {
	    this.asContent = asContent;
	}
	
	
	
	
	/**
	 * Return asLocatedEntity.
	 * @return asLocatedEntity
	 */
	public net.ihe.gazelle.hl7v3.coctmt070000UV01.COCTMT070000UV01LocatedEntity getAsLocatedEntity() {
	    return asLocatedEntity;
	}
	
	/**
	 * Set a value to attribute asLocatedEntity.
     */
	public void setAsLocatedEntity(net.ihe.gazelle.hl7v3.coctmt070000UV01.COCTMT070000UV01LocatedEntity asLocatedEntity) {
	    this.asLocatedEntity = asLocatedEntity;
	}
	
	
	
	
	/**
	 * Return additive.
	 * @return additive
	 */
	public List<net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVAdditive2> getAdditive() {
		if (additive == null) {
	        additive = new ArrayList<>();
	    }
	    return additive;
	}
	
	/**
	 * Set a value to attribute additive.
     */
	public void setAdditive(List<net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVAdditive2> additive) {
	    this.additive = additive;
	}
	
	
	
	/**
	 * Add a additive to the additive collection.
	 * @param additive_elt Element to add.
	 */
	public void addAdditive(net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVAdditive2 additive_elt) {
	    this.additive.add(additive_elt);
	}
	
	/**
	 * Remove a additive to the additive collection.
	 * @param additive_elt Element to remove
	 */
	public void removeAdditive(net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVAdditive2 additive_elt) {
	    this.additive.remove(additive_elt);
	}
	
	/**
	 * Return classCode.
	 * @return classCode
	 */
	public net.ihe.gazelle.hl7v3.voc.EntityClassContainer getClassCode() {
	    return classCode;
	}
	
	/**
	 * Set a value to attribute classCode.
     */
	public void setClassCode(net.ihe.gazelle.hl7v3.voc.EntityClassContainer classCode) {
	    this.classCode = classCode;
	}
	
	
	
	
	/**
	 * Return determinerCode.
	 * @return determinerCode
	 */
	public net.ihe.gazelle.hl7v3.voc.EntityDeterminer getDeterminerCode() {
	    return determinerCode;
	}
	
	/**
	 * Set a value to attribute determinerCode.
     */
	public void setDeterminerCode(net.ihe.gazelle.hl7v3.voc.EntityDeterminer determinerCode) {
	    this.determinerCode = determinerCode;
	}
	
	
	
	
	/**
	 * Return nullFlavor.
	 * @return nullFlavor
	 */
	public net.ihe.gazelle.hl7v3.voc.NullFlavor getNullFlavor() {
	    return nullFlavor;
	}
	
	/**
	 * Set a value to attribute nullFlavor.
     */
	public void setNullFlavor(net.ihe.gazelle.hl7v3.voc.NullFlavor nullFlavor) {
	    this.nullFlavor = nullFlavor;
	}
	
	
	
	
	
	public Node get_xmlNodePresentation() {
		if (_xmlNodePresentation == null){
				JAXBContext jc;
				DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
				dbf.setNamespaceAware(true);
				DocumentBuilder db = null;
				Document doc = null;
				try {
					db = dbf.newDocumentBuilder();
					doc = db.newDocument();
				} catch (ParserConfigurationException ignored) {}
				try {
					jc = JAXBContext.newInstance("net.ihe.gazelle.hl7v3.coctmt080000UV");
					Marshaller m = jc.createMarshaller();
					m.marshal(this, doc);
					_xmlNodePresentation = doc.getElementsByTagNameNS("urn:hl7-org:v3", "COCT_MT080000UV.Container").item(0);
				} catch (JAXBException e) {
					try{
						db = dbf.newDocumentBuilder();
						_xmlNodePresentation = db.newDocument();
					}
					catch(Exception ignored){}
				}
			}
			return _xmlNodePresentation;
	}
	
	public void set_xmlNodePresentation(Node _xmlNodePresentation) {
		this._xmlNodePresentation = _xmlNodePresentation;
	}
	
	
	

	
	/**
     * validate by a module of validation
     * 
     */
   public static void validateByModule(COCTMT080000UVContainer cOCTMT080000UVContainer, String _location, ConstraintValidatorModule cvm, List<net.ihe.gazelle.validation.Notification> diagnostic){
   		if (cOCTMT080000UVContainer != null){
   			cvm.validate(cOCTMT080000UVContainer, _location, diagnostic);
			{
				int i = 0;
				for (net.ihe.gazelle.hl7v3.datatypes.CS realmCode: cOCTMT080000UVContainer.getRealmCode()){
					net.ihe.gazelle.hl7v3.datatypes.CS.validateByModule(realmCode, _location + "/realmCode[" + i + "]", cvm, diagnostic);
					i++;
				}
			}
			
			net.ihe.gazelle.hl7v3.datatypes.II.validateByModule(cOCTMT080000UVContainer.getTypeId(), _location + "/typeId", cvm, diagnostic);
			{
				int i = 0;
				for (net.ihe.gazelle.hl7v3.datatypes.II templateId: cOCTMT080000UVContainer.getTemplateId()){
					net.ihe.gazelle.hl7v3.datatypes.II.validateByModule(templateId, _location + "/templateId[" + i + "]", cvm, diagnostic);
					i++;
				}
			}
			
			net.ihe.gazelle.hl7v3.datatypes.II.validateByModule(cOCTMT080000UVContainer.getId(), _location + "/id", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.CE.validateByModule(cOCTMT080000UVContainer.getCode(), _location + "/code", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.ED.validateByModule(cOCTMT080000UVContainer.getDesc(), _location + "/desc", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.CE.validateByModule(cOCTMT080000UVContainer.getRiskCode(), _location + "/riskCode", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.CE.validateByModule(cOCTMT080000UVContainer.getHandlingCode(), _location + "/handlingCode", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.PQ.validateByModule(cOCTMT080000UVContainer.getCapacityQuantity(), _location + "/capacityQuantity", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.PQ.validateByModule(cOCTMT080000UVContainer.getHeightQuantity(), _location + "/heightQuantity", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.PQ.validateByModule(cOCTMT080000UVContainer.getDiameterQuantity(), _location + "/diameterQuantity", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.CE.validateByModule(cOCTMT080000UVContainer.getCapTypeCode(), _location + "/capTypeCode", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.CE.validateByModule(cOCTMT080000UVContainer.getSeparatorTypeCode(), _location + "/separatorTypeCode", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.PQ.validateByModule(cOCTMT080000UVContainer.getBarrierDeltaQuantity(), _location + "/barrierDeltaQuantity", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.PQ.validateByModule(cOCTMT080000UVContainer.getBottomDeltaQuantity(), _location + "/bottomDeltaQuantity", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVIdentifiedContainer.validateByModule(cOCTMT080000UVContainer.getAsIdentifiedContainer(), _location + "/asIdentifiedContainer", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVContent3.validateByModule(cOCTMT080000UVContainer.getAsContent(), _location + "/asContent", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.coctmt070000UV01.COCTMT070000UV01LocatedEntity.validateByModule(cOCTMT080000UVContainer.getAsLocatedEntity(), _location + "/asLocatedEntity", cvm, diagnostic);
			{
				int i = 0;
				for (net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVAdditive2 additive: cOCTMT080000UVContainer.getAdditive()){
					net.ihe.gazelle.hl7v3.coctmt080000UV.COCTMT080000UVAdditive2.validateByModule(additive, _location + "/additive[" + i + "]", cvm, diagnostic);
					i++;
				}
			}
			
    	}
    }

}