/**
 * SC.java
 * <p>
 * File generated from the datatypes::SC 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.XmlAttribute;
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 SC.
 *
 * 
 */

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SC", propOrder = {
	"code",
	"codeSystem",
	"codeSystemName",
	"codeSystemVersion",
	"displayName"
})
@XmlRootElement(name = "SC")
public class SC extends net.ihe.gazelle.hl7v3.datatypes.ST implements java.io.Serializable {
	
	/**
	 * 
	 */
	@Serial
    private static final long serialVersionUID = 1L;

	
	/**
	 * 
	                     The plain code symbol defined by the code system.
	                     For example, "784.0" is the code symbol of the ICD-9
	                     code "784.0" for headache.
	                  .
	 */
	@XmlAttribute(name = "code")
	public String code;
	/**
	 * 
	                     Specifies the code system that defines the code.
	                  .
	 */
	@XmlAttribute(name = "codeSystem")
	public String codeSystem;
	/**
	 * 
	                     A common name of the coding system.
	                  .
	 */
	@XmlAttribute(name = "codeSystemName")
	public String codeSystemName;
	/**
	 * 
	                     If applicable, a version descriptor defined
	                     specifically for the given code system.
	                  .
	 */
	@XmlAttribute(name = "codeSystemVersion")
	public String codeSystemVersion;
	/**
	 * 
	                     A name or title for the code, under which the sending
	                     system shows the code value to its users.
	                  .
	 */
	@XmlAttribute(name = "displayName")
	public String displayName;
	
	/**
	 * An attribute containing marshalled element node
	 */
	@XmlTransient
	private org.w3c.dom.Node _xmlNodePresentation;
	
	
	/**
	 * Return code.
	 * @return code : 
	                     The plain code symbol defined by the code system.
	                     For example, "784.0" is the code symbol of the ICD-9
	                     code "784.0" for headache.
	 */
	public String getCode() {
	    return code;
	}
	
	/**
	 * Set a value to attribute code.
	 * @param code : 
	                     The plain code symbol defined by the code system.
	                     For example, "784.0" is the code symbol of the ICD-9
	                     code "784.0" for headache.

	 */
	public void setCode(String code) {
	    this.code = code;
	}
	
	
	
	
	/**
	 * Return codeSystem.
	 * @return codeSystem : 
	                     Specifies the code system that defines the code.

	 */
	public String getCodeSystem() {
	    return codeSystem;
	}
	
	/**
	 * Set a value to attribute codeSystem.
	 * @param codeSystem : 
	                     Specifies the code system that defines the code.

	 */
	public void setCodeSystem(String codeSystem) {
	    this.codeSystem = codeSystem;
	}
	
	
	
	
	/**
	 * Return codeSystemName.
	 * @return codeSystemName : 
	                     A common name of the coding system.

	 */
	public String getCodeSystemName() {
	    return codeSystemName;
	}
	
	/**
	 * Set a value to attribute codeSystemName.
	 * @param codeSystemName : 
	                     A common name of the coding system.

	 */
	public void setCodeSystemName(String codeSystemName) {
	    this.codeSystemName = codeSystemName;
	}
	
	
	
	
	/**
	 * Return codeSystemVersion.
	 * @return codeSystemVersion : 
	                     If applicable, a version descriptor defined
	                     specifically for the given code system.

	                  
	 */
	public String getCodeSystemVersion() {
	    return codeSystemVersion;
	}
	
	/**
	 * Set a value to attribute codeSystemVersion.
	 * @param codeSystemVersion : 
	                     If applicable, a version descriptor defined
	                     specifically for the given code system.

	 */
	public void setCodeSystemVersion(String codeSystemVersion) {
	    this.codeSystemVersion = codeSystemVersion;
	}
	
	
	
	
	/**
	 * Return displayName.
	 * @return displayName : 
	                     A name or title for the code, under which the sending
	                     system shows the code value to its users.

	 */
	public String getDisplayName() {
	    return displayName;
	}
	
	/**
	 * Set a value to attribute displayName.
	 * @param displayName : 
	                     A name or title for the code, under which the sending
	                     system shows the code value to its users.
	 */
	public void setDisplayName(String displayName) {
	    this.displayName = displayName;
	}
	
	
	
	
	
	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", "SC").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(SC sC, String _location, ConstraintValidatorModule cvm, List<net.ihe.gazelle.validation.Notification> diagnostic){
   		if (sC != null){
   			net.ihe.gazelle.hl7v3.datatypes.ST.validateByModule(sC, _location, cvm, diagnostic);
    	}
    }

}