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

// End of user code
import java.io.Serial;
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.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 IVLPPDTS.
 *
 */

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "IVL_PPD_TS", propOrder = {
	"low",
	"width",
	"high",
	"center",
})
@XmlRootElement(name = "IVL_PPD_TS")
public class IVLPPDTS extends net.ihe.gazelle.hl7v3.datatypes.SXCMPPDTS implements java.io.Serializable {
	
	/**
	 * 
	 */
	@Serial
    private static final long serialVersionUID = 1L;

	
	/**
	 * 
	                           The low limit of the interval.
	                        .
	 */
	@XmlElement(name = "low", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.IVXBPPDTS low;
	/**
	 * 
	                           The difference between high and low boundary. The
	                           purpose of distinguishing a width property is to
	                           handle all cases of incomplete information
	                           symmetrically. In any interval representation only
	                           two of the three properties high, low, and width need
	                           to be stated and the third can be derived.
	                        .
	 */
	@XmlElement(name = "width", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.PPDPQ width;
	/**
	 * 
	                           The high limit of the interval.
	                        .
	 */
	@XmlElement(name = "high", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.IVXBPPDTS high;

	/**
	 * 
	                           The high limit of the interval.
	 */
	@XmlElement(name = "center", namespace = "urn:hl7-org:v3")
	public net.ihe.gazelle.hl7v3.datatypes.PPDTS center;
	
	/**
	 * An attribute containing marshalled element node
	 */
	@XmlTransient
	private org.w3c.dom.Node _xmlNodePresentation;


    /**
     * Return low.
     * @return low :
    The low limit of the interval.
    */
	public net.ihe.gazelle.hl7v3.datatypes.IVXBPPDTS getLow() {
	    return low;
	}

    /**
     * Set a value to attribute low.
     * @param low :
    The low limit of the interval.
    */
	public void setLow(net.ihe.gazelle.hl7v3.datatypes.IVXBPPDTS low) {
	    this.low = low;
	}



    /**
     * Return width.
     * @return width :
    The difference between high and low boundary. The
    purpose of distinguishing a width property is to
    handle all cases of incomplete information
    symmetrically. In any interval representation only
    two of the three properties high, low, and width need
    to be stated and the third can be derived.
    */
	public net.ihe.gazelle.hl7v3.datatypes.PPDPQ getWidth() {
	    return width;
	}

    /**
     * Set a value to attribute width.
     * @param width :
    The difference between high and low boundary. The
    purpose of distinguishing a width property is to
    handle all cases of incomplete information
    symmetrically. In any interval representation only
    two of the three properties high, low, and width need
    to be stated and the third can be derived.
    */
	public void setWidth(net.ihe.gazelle.hl7v3.datatypes.PPDPQ width) {
	    this.width = width;
	}



    /**
     * Return high.
     * @return high :
    The high limit of the interval.
    */

	public net.ihe.gazelle.hl7v3.datatypes.IVXBPPDTS getHigh() {
	    return high;
	}

    /**
     * Set a value to attribute high.
     * @param high :
    The high limit of the interval.
    */

	public void setHigh(net.ihe.gazelle.hl7v3.datatypes.IVXBPPDTS high) {
	    this.high = high;
	}

    /**
     * Return center.
     * @return center :
    The arithmetic mean of the interval (low plus high
    divided by 2). The purpose of distinguishing the center
    as a semantic property is for conversions of intervals
    from and to point values.
    */

	public net.ihe.gazelle.hl7v3.datatypes.PPDTS getCenter() {
	    return center;
	}

    /**
     * Set a value to attribute center.
     * @param center :
    The arithmetic mean of the interval (low plus high
    divided by 2). The purpose of distinguishing the center
    as a semantic property is for conversions of intervals
    from and to point values.
    */
	public void setCenter(net.ihe.gazelle.hl7v3.datatypes.PPDTS center) {
	    this.center = center;
	}

	
	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.datatypes");
					Marshaller m = jc.createMarshaller();
					m.marshal(this, doc);
					_xmlNodePresentation = doc.getElementsByTagNameNS("urn:hl7-org:v3", "IVL_PPD_TS").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(IVLPPDTS iVLPPDTS, String _location, ConstraintValidatorModule cvm, List<net.ihe.gazelle.validation.Notification> diagnostic){
   		if (iVLPPDTS != null){
   			net.ihe.gazelle.hl7v3.datatypes.SXCMPPDTS.validateByModule(iVLPPDTS, _location, cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.IVXBPPDTS.validateByModule(iVLPPDTS.getLow(), _location + "/low", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.PPDPQ.validateByModule(iVLPPDTS.getWidth(), _location + "/width", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.IVXBPPDTS.validateByModule(iVLPPDTS.getHigh(), _location + "/high", cvm, diagnostic);
			net.ihe.gazelle.hl7v3.datatypes.PPDTS.validateByModule(iVLPPDTS.getCenter(), _location + "/center", cvm, diagnostic);
    	}
    }

}