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

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

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PRPA_MT201306UV02.QueryByParameter", propOrder = {
	"realmCode",
	"typeId",
	"templateId",
	"queryId",
	"statusCode",
	"modifyCode",
	"responseElementGroupId",
	"responseModalityCode",
	"responsePriorityCode",
	"initialQuantity",
	"initialQuantityCode",
	"executionAndDeliveryTime",
	"matchCriterionList",
	"parameterList",
	"sortControl",
	"nullFlavor"
})
@XmlRootElement(name = "PRPA_MT201306UV02.QueryByParameter")
public class PRPAMT201306UV02QueryByParameter 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 = "queryId", required = true, namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.II queryId;
	@XmlElement(name = "statusCode", required = true, namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.CS statusCode;
	@XmlElement(name = "modifyCode", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.CS modifyCode;
	@XmlElement(name = "responseElementGroupId", namespace = "urn:hl7-org:v3")
	public List<net.ihe.gazelle.hl7v3.datatypes.II> responseElementGroupId;
	@XmlElement(name = "responseModalityCode", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.CS responseModalityCode;
	@XmlElement(name = "responsePriorityCode", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.CS responsePriorityCode;
	@XmlElement(name = "initialQuantity", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.INT initialQuantity;
	@XmlElement(name = "initialQuantityCode", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.CE initialQuantityCode;
	@XmlElement(name = "executionAndDeliveryTime", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.TS executionAndDeliveryTime;
	@XmlElement(name = "matchCriterionList", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02MatchCriterionList matchCriterionList;
	@XmlElement(name = "parameterList", required = true, namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02ParameterList parameterList;
	@XmlElement(name = "sortControl", namespace = "urn:hl7-org:v3")
	public List<net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02SortControl> sortControl;
	@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 queryId.
	 * @return queryId
	 */
	public net.ihe.gazelle.hl7v3.datatypes.II getQueryId() {
	    return queryId;
	}
	
	/**
	 * Set a value to attribute queryId.
     */
	public void setQueryId(net.ihe.gazelle.hl7v3.datatypes.II queryId) {
	    this.queryId = queryId;
	}
	
	
	
	
	/**
	 * Return statusCode.
	 * @return statusCode
	 */
	public net.ihe.gazelle.hl7v3.datatypes.CS getStatusCode() {
	    return statusCode;
	}
	
	/**
	 * Set a value to attribute statusCode.
     */
	public void setStatusCode(net.ihe.gazelle.hl7v3.datatypes.CS statusCode) {
	    this.statusCode = statusCode;
	}
	
	
	
	
	/**
	 * Return modifyCode.
	 * @return modifyCode
	 */
	public net.ihe.gazelle.hl7v3.datatypes.CS getModifyCode() {
	    return modifyCode;
	}
	
	/**
	 * Set a value to attribute modifyCode.
     */
	public void setModifyCode(net.ihe.gazelle.hl7v3.datatypes.CS modifyCode) {
	    this.modifyCode = modifyCode;
	}
	
	
	
	
	/**
	 * Return responseElementGroupId.
	 * @return responseElementGroupId
	 */
	public List<net.ihe.gazelle.hl7v3.datatypes.II> getResponseElementGroupId() {
		if (responseElementGroupId == null) {
	        responseElementGroupId = new ArrayList<>();
	    }
	    return responseElementGroupId;
	}
	
	/**
	 * Set a value to attribute responseElementGroupId.
     */
	public void setResponseElementGroupId(List<net.ihe.gazelle.hl7v3.datatypes.II> responseElementGroupId) {
	    this.responseElementGroupId = responseElementGroupId;
	}
	
	
	
	/**
	 * Add a responseElementGroupId to the responseElementGroupId collection.
	 * @param responseElementGroupId_elt Element to add.
	 */
	public void addResponseElementGroupId(net.ihe.gazelle.hl7v3.datatypes.II responseElementGroupId_elt) {
	    this.responseElementGroupId.add(responseElementGroupId_elt);
	}
	
	/**
	 * Remove a responseElementGroupId to the responseElementGroupId collection.
	 * @param responseElementGroupId_elt Element to remove
	 */
	public void removeResponseElementGroupId(net.ihe.gazelle.hl7v3.datatypes.II responseElementGroupId_elt) {
	    this.responseElementGroupId.remove(responseElementGroupId_elt);
	}
	
	/**
	 * Return responseModalityCode.
	 * @return responseModalityCode
	 */
	public net.ihe.gazelle.hl7v3.datatypes.CS getResponseModalityCode() {
	    return responseModalityCode;
	}
	
	/**
	 * Set a value to attribute responseModalityCode.
     */
	public void setResponseModalityCode(net.ihe.gazelle.hl7v3.datatypes.CS responseModalityCode) {
	    this.responseModalityCode = responseModalityCode;
	}
	
	
	
	
	/**
	 * Return responsePriorityCode.
	 * @return responsePriorityCode
	 */
	public net.ihe.gazelle.hl7v3.datatypes.CS getResponsePriorityCode() {
	    return responsePriorityCode;
	}
	
	/**
	 * Set a value to attribute responsePriorityCode.
     */
	public void setResponsePriorityCode(net.ihe.gazelle.hl7v3.datatypes.CS responsePriorityCode) {
	    this.responsePriorityCode = responsePriorityCode;
	}
	
	
	
	
	/**
	 * Return initialQuantity.
	 * @return initialQuantity
	 */
	public net.ihe.gazelle.hl7v3.datatypes.INT getInitialQuantity() {
	    return initialQuantity;
	}
	
	/**
	 * Set a value to attribute initialQuantity.
     */
	public void setInitialQuantity(net.ihe.gazelle.hl7v3.datatypes.INT initialQuantity) {
	    this.initialQuantity = initialQuantity;
	}
	
	
	
	
	/**
	 * Return initialQuantityCode.
	 * @return initialQuantityCode
	 */
	public net.ihe.gazelle.hl7v3.datatypes.CE getInitialQuantityCode() {
	    return initialQuantityCode;
	}
	
	/**
	 * Set a value to attribute initialQuantityCode.
     */
	public void setInitialQuantityCode(net.ihe.gazelle.hl7v3.datatypes.CE initialQuantityCode) {
	    this.initialQuantityCode = initialQuantityCode;
	}
	
	
	
	
	/**
	 * Return executionAndDeliveryTime.
	 * @return executionAndDeliveryTime
	 */
	public net.ihe.gazelle.hl7v3.datatypes.TS getExecutionAndDeliveryTime() {
	    return executionAndDeliveryTime;
	}
	
	/**
	 * Set a value to attribute executionAndDeliveryTime.
     */
	public void setExecutionAndDeliveryTime(net.ihe.gazelle.hl7v3.datatypes.TS executionAndDeliveryTime) {
	    this.executionAndDeliveryTime = executionAndDeliveryTime;
	}
	
	
	
	
	/**
	 * Return matchCriterionList.
	 * @return matchCriterionList
	 */
	public net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02MatchCriterionList getMatchCriterionList() {
	    return matchCriterionList;
	}
	
	/**
	 * Set a value to attribute matchCriterionList.
     */
	public void setMatchCriterionList(net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02MatchCriterionList matchCriterionList) {
	    this.matchCriterionList = matchCriterionList;
	}
	
	
	
	
	/**
	 * Return parameterList.
	 * @return parameterList
	 */
	public net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02ParameterList getParameterList() {
	    return parameterList;
	}
	
	/**
	 * Set a value to attribute parameterList.
     */
	public void setParameterList(net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02ParameterList parameterList) {
	    this.parameterList = parameterList;
	}
	
	
	
	
	/**
	 * Return sortControl.
	 * @return sortControl
	 */
	public List<net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02SortControl> getSortControl() {
		if (sortControl == null) {
	        sortControl = new ArrayList<>();
	    }
	    return sortControl;
	}
	
	/**
	 * Set a value to attribute sortControl.
     */
	public void setSortControl(List<net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02SortControl> sortControl) {
	    this.sortControl = sortControl;
	}
	
	
	
	/**
	 * Add a sortControl to the sortControl collection.
	 * @param sortControl_elt Element to add.
	 */
	public void addSortControl(net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02SortControl sortControl_elt) {
	    this.sortControl.add(sortControl_elt);
	}
	
	/**
	 * Remove a sortControl to the sortControl collection.
	 * @param sortControl_elt Element to remove
	 */
	public void removeSortControl(net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02SortControl sortControl_elt) {
	    this.sortControl.remove(sortControl_elt);
	}
	
	/**
	 * 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.prpamt201306UV02");
					Marshaller m = jc.createMarshaller();
					m.marshal(this, doc);
					_xmlNodePresentation = doc.getElementsByTagNameNS("urn:hl7-org:v3", "PRPA_MT201306UV02.QueryByParameter").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(PRPAMT201306UV02QueryByParameter pRPAMT201306UV02QueryByParameter, String _location, ConstraintValidatorModule cvm, List<net.ihe.gazelle.validation.Notification> diagnostic){
   		if (pRPAMT201306UV02QueryByParameter != null){
   			cvm.validate(pRPAMT201306UV02QueryByParameter, _location, diagnostic);
			{
				int i = 0;
				for (net.ihe.gazelle.hl7v3.datatypes.CS realmCode: pRPAMT201306UV02QueryByParameter.getRealmCode()){
					net.ihe.gazelle.hl7v3.datatypes.CS.validateByModule(realmCode, _location + "/realmCode[" + i + "]", cvm, diagnostic);
					i++;
				}
			}
			
			net.ihe.gazelle.hl7v3.datatypes.II.validateByModule(pRPAMT201306UV02QueryByParameter.getTypeId(), _location + "/typeId", cvm, diagnostic);
			{
				int i = 0;
				for (net.ihe.gazelle.hl7v3.datatypes.II templateId: pRPAMT201306UV02QueryByParameter.getTemplateId()){
					net.ihe.gazelle.hl7v3.datatypes.II.validateByModule(templateId, _location + "/templateId[" + i + "]", cvm, diagnostic);
					i++;
				}
			}
			
			net.ihe.gazelle.hl7v3.datatypes.II.validateByModule(pRPAMT201306UV02QueryByParameter.getQueryId(), _location + "/queryId", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.CS.validateByModule(pRPAMT201306UV02QueryByParameter.getStatusCode(), _location + "/statusCode", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.CS.validateByModule(pRPAMT201306UV02QueryByParameter.getModifyCode(), _location + "/modifyCode", cvm, diagnostic);
			{
				int i = 0;
				for (net.ihe.gazelle.hl7v3.datatypes.II responseElementGroupId: pRPAMT201306UV02QueryByParameter.getResponseElementGroupId()){
					net.ihe.gazelle.hl7v3.datatypes.II.validateByModule(responseElementGroupId, _location + "/responseElementGroupId[" + i + "]", cvm, diagnostic);
					i++;
				}
			}
			
			net.ihe.gazelle.hl7v3.datatypes.CS.validateByModule(pRPAMT201306UV02QueryByParameter.getResponseModalityCode(), _location + "/responseModalityCode", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.CS.validateByModule(pRPAMT201306UV02QueryByParameter.getResponsePriorityCode(), _location + "/responsePriorityCode", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.INT.validateByModule(pRPAMT201306UV02QueryByParameter.getInitialQuantity(), _location + "/initialQuantity", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.CE.validateByModule(pRPAMT201306UV02QueryByParameter.getInitialQuantityCode(), _location + "/initialQuantityCode", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.TS.validateByModule(pRPAMT201306UV02QueryByParameter.getExecutionAndDeliveryTime(), _location + "/executionAndDeliveryTime", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02MatchCriterionList.validateByModule(pRPAMT201306UV02QueryByParameter.getMatchCriterionList(), _location + "/matchCriterionList", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02ParameterList.validateByModule(pRPAMT201306UV02QueryByParameter.getParameterList(), _location + "/parameterList", cvm, diagnostic);
			{
				int i = 0;
				for (net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02SortControl sortControl: pRPAMT201306UV02QueryByParameter.getSortControl()){
					net.ihe.gazelle.hl7v3.prpamt201306UV02.PRPAMT201306UV02SortControl.validateByModule(sortControl, _location + "/sortControl[" + i + "]", cvm, diagnostic);
					i++;
				}
			}
			
    	}
    }

}