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

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 QUQIMT000001UV01Overseer.
 *
 */

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "QUQI_MT000001UV01.Overseer", propOrder = {
	"realmCode",
	"typeId",
	"templateId",
	"noteText",
	"time",
	"modeCode",
	"signatureCode",
	"signatureText",
	"assignedPerson",
	"contextControlCode",
	"nullFlavor",
	"typeCode"
})
@XmlRootElement(name = "QUQI_MT000001UV01.Overseer")
public class QUQIMT000001UV01Overseer 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 = "noteText", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.ED noteText;
	@XmlElement(name = "time", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.IVLTS time;
	@XmlElement(name = "modeCode", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.CE modeCode;
	@XmlElement(name = "signatureCode", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.CE signatureCode;
	@XmlElement(name = "signatureText", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.ED signatureText;
	@XmlElement(name = "assignedPerson", required = true, namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.coctmt090100UV01.COCTMT090100UV01AssignedPerson assignedPerson;
	@XmlAttribute(name = "contextControlCode")
	public net.ihe.gazelle.hl7v3.voc.ContextControl contextControlCode;
	@XmlAttribute(name = "nullFlavor")
	public net.ihe.gazelle.hl7v3.voc.NullFlavor nullFlavor;
	@XmlAttribute(name = "typeCode", required = true)
	public net.ihe.gazelle.hl7v3.voc.XParticipationVrfRespSprfWit typeCode;
	
	/**
	 * 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 noteText.
	 * @return noteText
	 */
	public net.ihe.gazelle.hl7v3.datatypes.ED getNoteText() {
	    return noteText;
	}
	
	/**
	 * Set a value to attribute noteText.
     */
	public void setNoteText(net.ihe.gazelle.hl7v3.datatypes.ED noteText) {
	    this.noteText = noteText;
	}
	
	
	
	
	/**
	 * Return time.
	 * @return time
	 */
	public net.ihe.gazelle.hl7v3.datatypes.IVLTS getTime() {
	    return time;
	}
	
	/**
	 * Set a value to attribute time.
     */
	public void setTime(net.ihe.gazelle.hl7v3.datatypes.IVLTS time) {
	    this.time = time;
	}
	
	
	
	
	/**
	 * Return modeCode.
	 * @return modeCode
	 */
	public net.ihe.gazelle.hl7v3.datatypes.CE getModeCode() {
	    return modeCode;
	}
	
	/**
	 * Set a value to attribute modeCode.
     */
	public void setModeCode(net.ihe.gazelle.hl7v3.datatypes.CE modeCode) {
	    this.modeCode = modeCode;
	}
	
	
	
	
	/**
	 * Return signatureCode.
	 * @return signatureCode
	 */
	public net.ihe.gazelle.hl7v3.datatypes.CE getSignatureCode() {
	    return signatureCode;
	}
	
	/**
	 * Set a value to attribute signatureCode.
     */
	public void setSignatureCode(net.ihe.gazelle.hl7v3.datatypes.CE signatureCode) {
	    this.signatureCode = signatureCode;
	}
	
	
	
	
	/**
	 * Return signatureText.
	 * @return signatureText
	 */
	public net.ihe.gazelle.hl7v3.datatypes.ED getSignatureText() {
	    return signatureText;
	}
	
	/**
	 * Set a value to attribute signatureText.
     */
	public void setSignatureText(net.ihe.gazelle.hl7v3.datatypes.ED signatureText) {
	    this.signatureText = signatureText;
	}
	
	
	
	
	/**
	 * Return assignedPerson.
	 * @return assignedPerson
	 */
	public net.ihe.gazelle.hl7v3.coctmt090100UV01.COCTMT090100UV01AssignedPerson getAssignedPerson() {
	    return assignedPerson;
	}
	
	/**
	 * Set a value to attribute assignedPerson.
     */
	public void setAssignedPerson(net.ihe.gazelle.hl7v3.coctmt090100UV01.COCTMT090100UV01AssignedPerson assignedPerson) {
	    this.assignedPerson = assignedPerson;
	}
	
	
	
	
	/**
	 * Return contextControlCode.
	 * @return contextControlCode
	 */
	public net.ihe.gazelle.hl7v3.voc.ContextControl getContextControlCode() {
	    return contextControlCode;
	}
	
	/**
	 * Set a value to attribute contextControlCode.
     */
	public void setContextControlCode(net.ihe.gazelle.hl7v3.voc.ContextControl contextControlCode) {
	    this.contextControlCode = contextControlCode;
	}
	
	
	
	
	/**
	 * 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;
	}
	
	
	
	
	/**
	 * Return typeCode.
	 * @return typeCode
	 */
	public net.ihe.gazelle.hl7v3.voc.XParticipationVrfRespSprfWit getTypeCode() {
	    return typeCode;
	}
	
	/**
	 * Set a value to attribute typeCode.
     */
	public void setTypeCode(net.ihe.gazelle.hl7v3.voc.XParticipationVrfRespSprfWit typeCode) {
	    this.typeCode = typeCode;
	}
	
	
	
	
	
	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.quqimt000001UV01");
					Marshaller m = jc.createMarshaller();
					m.marshal(this, doc);
					_xmlNodePresentation = doc.getElementsByTagNameNS("urn:hl7-org:v3", "QUQI_MT000001UV01.Overseer").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(QUQIMT000001UV01Overseer qUQIMT000001UV01Overseer, String _location, ConstraintValidatorModule cvm, List<net.ihe.gazelle.validation.Notification> diagnostic){
   		if (qUQIMT000001UV01Overseer != null){
   			cvm.validate(qUQIMT000001UV01Overseer, _location, diagnostic);
			{
				int i = 0;
				for (net.ihe.gazelle.hl7v3.datatypes.CS realmCode: qUQIMT000001UV01Overseer.getRealmCode()){
					net.ihe.gazelle.hl7v3.datatypes.CS.validateByModule(realmCode, _location + "/realmCode[" + i + "]", cvm, diagnostic);
					i++;
				}
			}
			
			net.ihe.gazelle.hl7v3.datatypes.II.validateByModule(qUQIMT000001UV01Overseer.getTypeId(), _location + "/typeId", cvm, diagnostic);
			{
				int i = 0;
				for (net.ihe.gazelle.hl7v3.datatypes.II templateId: qUQIMT000001UV01Overseer.getTemplateId()){
					net.ihe.gazelle.hl7v3.datatypes.II.validateByModule(templateId, _location + "/templateId[" + i + "]", cvm, diagnostic);
					i++;
				}
			}
			
			net.ihe.gazelle.hl7v3.datatypes.ED.validateByModule(qUQIMT000001UV01Overseer.getNoteText(), _location + "/noteText", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.IVLTS.validateByModule(qUQIMT000001UV01Overseer.getTime(), _location + "/time", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.CE.validateByModule(qUQIMT000001UV01Overseer.getModeCode(), _location + "/modeCode", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.CE.validateByModule(qUQIMT000001UV01Overseer.getSignatureCode(), _location + "/signatureCode", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.ED.validateByModule(qUQIMT000001UV01Overseer.getSignatureText(), _location + "/signatureText", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.coctmt090100UV01.COCTMT090100UV01AssignedPerson.validateByModule(qUQIMT000001UV01Overseer.getAssignedPerson(), _location + "/assignedPerson", cvm, diagnostic);
    	}
    }

}