/*******************************************************************************
 *  Copyright 2017 Centre for Development of Advanced Computing(C-DAC), Pune
 *  
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  
 *    http://www.apache.org/licenses/LICENSE-2.0
 *  
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *******************************************************************************/
package cdac.medinfo.sdk.hl7282.baselibs.segments;

import cdac.medinfo.sdk.hl7282.baselibs.CWE;
import cdac.medinfo.sdk.hl7282.baselibs.DR;
import cdac.medinfo.sdk.hl7282.baselibs.DT;
import cdac.medinfo.sdk.hl7282.baselibs.DTM;
import cdac.medinfo.sdk.hl7282.baselibs.EI;
import cdac.medinfo.sdk.hl7282.baselibs.HD;
import cdac.medinfo.sdk.hl7282.baselibs.SAD;
import cdac.medinfo.sdk.hl7282.baselibs.SI;
import cdac.medinfo.sdk.hl7282.baselibs.XAD;
import cdac.medinfo.sdk.hl7282.baselibs.XON;
import cdac.medinfo.sdk.hl7282.commoninterface.IDataType;
import cdac.medinfo.sdk.hl7282.commoninterface.ISingleCollection;
import cdac.medinfo.sdk.hl7282.exceptions.FieldMissingException;
import cdac.medinfo.sdk.hl7282.exceptions.InvalidSegmentException;
import cdac.medinfo.sdk.hl7282.utils.EnumSegments;
import cdac.medinfo.sdk.hl7282.utils.SingleCollection;

/**
 * EDU - Educational Detail Segment   <p>
 * The EDU segment adds detailed educational information to the staff member identified by the STF segment.    
 * <p>Represents an HL7 EDU message segment. 
 * This segment has the following fields:</p><p>
 * EDU-1: Set ID _ EDU (SI)<b>Required</b><br> 
 * EDU-2: Academic Degree (CWE)<b>Optional</b><br> 
 * EDU-3: Academic Degree Program Date Range (DR)<b>Optional</b><br> 
 * EDU-4: Academic Degree Program Participation Date Range (DR)<b>Optional</b><br> 
 * EDU-5: Academic Degree Granted Date (DT)<b>Optional</b><br> 
 * EDU-6: School (XON)<b>Optional</b><br> 
 * EDU-7: School Type Code (CWE)<b>Optional</b><br> 
 * EDU-8: School Address (XAD)<b>Optional</b><br> 
 * EDU-9: Major Field of Study (CWE)<b>Optional</b><br><p> 
 * This class provides mechanism to validate message against HL7 v 2.8.2 standard.
 * The class provides accessors & mutators for the elements mentioned above.
 * The class has validate method which validates Message against HL7 v 2.8.2 standard.
 *
 * <p>User can also create Segment through {@link SegmentFactory}
 */
 public class EDU extends Segment   
{
	

	/**
	 * Constructs the EDU segment.
	 */
	public EDU()
	{super(EnumSegments.HL7_SEG_EDU);
	}

	//Integer values used in getter/setter is unique item id defined 
	//for each attribute.

	/**
	 * Retrieves the Academic Degree.
	 * This field contains the standard classification award upon completion of a unified program of study.
	 * @return String - academicDegree
	 */
	public CWE getAcademicDegree() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1449);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Retrieves the Academic Degree Granted Date.
	 * This field contains the date of the academic degree is grant to the staff member.
	 * @return String - academicDegreeGrantedDate
	 */
	public DT getAcademicDegreeGrantedDate() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1451);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DT)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Retrieves the Academic Degree Program Date Range.
	 * This field contains the date range when the academic degree program take place.
	 * @return DR - academicDegreeProgramDateRange
	 */
	public DR getAcademicDegreeProgramDateRange() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1597);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DR)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Retrieves the Academic Degree Program Participation Date Range.
	 * This field contains the date range during which the staff member participated in the 
	 * academic degree program.
	 * @return DR - academicDegreeProgramParticipationDateRange
	 */
	public DR getAcademicDegreeProgramParticipationDateRange() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1450);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DR)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Retrieves the Major Field of Study.
	 * This field contains the subject of academic study associated with the specific 
	 * academic degree program pursued by the staff member as his/her area of specialization.
	 * @return ISingleCollection<CWE> - majorFieldofStudy
	 */
	public ISingleCollection<CWE> getMajorFieldofStudy() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1885);
		ISingleCollection<CWE> objDataList = new SingleCollection<CWE>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				CWE objCWE = (CWE)objDataType;
				objDataList.add(objCWE);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the School.
	 * This field contains the official name of the academic institution that granted the degree to the Staff Member.
	 * @return XON - school
	 */
	public XON getSchool() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1452);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (XON)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Retrieves the School Address.
	 * This field contains the postal address of the academic institution that granted the degree to the Staff Member. 
	 * @return XAD - schoolAddress
	 */
	public XAD getSchoolAddress() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1454);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (XAD)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Retrieves the School Type Code.
	 * This field contains the categorization of the academic institution that granted the degree to the Staff Member. 
	 * @return CWE - schoolTypeCode
	 */
	public CWE getSchoolTypeCode() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1453);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Retrieves the Set ID EDU.
	 * This field contains the number that identify this transaction.  
	 * @return String - setID_EDU
	 */
	public SI getSetID_EDU() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1448);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (SI)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Set the Set ID EDU.
	 * This field contains the number that identify this transaction.  
	 * @param strSetID_EDU This field contains the number that identifies transaction. 
	 */	
	public void setSetID_EDU(String strSetID_EDU) 
	{
		SI setID_EDU  = (SI)getDataElement(1448);
		setID_EDU.setValue(strSetID_EDU);
		setSetID_EDU(setID_EDU);
	}

	/**
	 * Set the Set ID EDU.
	 * This field contains the number that identify this transaction.
	 * @param objSetID_EDU Object of Set ID EDU.
	 */
	public void setSetID_EDU(SI objSetID_EDU)
	{
		setDataType(1448,objSetID_EDU);

	}

	/**
	 * Set the Academic Degree.
	 * This field contains the standard classification award upon completion of a unified program of study.
	 * @param strIdentifier Specifies of characters (the code) that uniquely identifies the item being referenced. 
	 * @param strText Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction. 
	 * @param strNameOfCodingSystem Identifies the coding scheme being used in the identifier component.
	 * @param strAlternateIdentifier Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
	 * @param strAlternateText Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
	 * @param strNameOfAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component. 
	 * @param strCodingSystemVersionID A sequence of characters that uniquely identifies a second alternate code.
	 * @param strAlternateCodingSystemVersionId This component carries the version for the coding system identified by components 4-6.
	 * @param strOriginalText The text as seen and/or selected by the user who entered the data.
	 * @param strSecondAlternateIdentifier A sequence of characters that uniquely identifies a second alternate code.
	 * @param strSecondAlternateText The descriptive or textual name of the alternate identifier.
	 * @param strNameofSecondAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component.
	 * @param strSecondAlternateCodingSystemVersionID This component carries the version for the coding system identified by components 10-12.
	 * @param strCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
	 * @param strValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
	 * @param strValueSetVersionID This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
	 * @param strAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
	 * @param strAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
	 * @param strAlternateValueSetVersionID This component carries the version for the value set identified by CWE.18. The version is a date.
	 * @param strSecondAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
	 * @param strSecondAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
	 * @param strSecondAlternateValueSetVersionID This component carries the version for the value set identified by CWE.21. The version is a date.
	 */
	public void setAcademicDegree(String strIdentifier,String strText,String strNameOfCodingSystem,
			String strAlternateIdentifier,String strAlternateText,String strNameOfAlternateCodingSystem, String strCodingSystemVersionID, String 				strAlternateCodingSystemVersionId,
			String strOriginalText, String  strSecondAlternateIdentifier, String strSecondAlternateText, 
			String strNameofSecondAlternateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, String strValueSetOID,
			String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID, String strAlternateValueSetVersionID,
			String  strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID, String strSecondAlternateValueSetVersionID)
	{
		CWE cwe  = (CWE)getDataElement(1449);
		cwe.setIdentifier(strIdentifier);
		cwe.setText(strText);
		cwe.setNameOfCodingSystem(strNameOfCodingSystem);
		cwe.setAlternateIdentifier(strAlternateIdentifier);
		cwe.setAlternateText(strAlternateText);
		cwe.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		cwe.setCodingSystemVersionID(strCodingSystemVersionID);
		cwe.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		cwe.setOriginalText(strOriginalText);
		cwe.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cwe.setSecondAlternateText(strSecondAlternateText);
		cwe.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		cwe.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cwe.setCodingSystemOID(strCodingSystemOID);
		cwe.setValueSetOID(strValueSetOID);
		cwe.setValueSetVersionID(strValueSetVersionID);
		cwe.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cwe.setAlternateValueSetOID(strAlternateValueSetOID);
		cwe.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cwe.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cwe.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cwe.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		setAcademicDegree(cwe);
	}

	/**
	 * Set the Academic Degree.
	 * This field contains the standard classification award upon completion of a unified program of study.
	 * @param objAcademicDegree Object of Academic Degree.
	 */
	public void setAcademicDegree(CWE objAcademicDegree)
	{
		setDataType(1449,objAcademicDegree);

	}

	/**
	 * Set the Academic Degree Program Date Range.
	 * This field contains the date range when the academic degree program take place. 
	 * @param objRangeStartDateTime Specifies the earliest date/time (time stamp) in the
	 * 								 specified range.
	 * @param objRangeEndDateTime Specifies the latest date/time in the specified range.
	 */	
	public void setAcademicDegreeProgramDateRange(DTM objRangeStartDateTime, DTM objRangeEndDateTime) 
	{
		DR academicDegreeProgramDateRange = (DR)getDataElement(1597);
		academicDegreeProgramDateRange.setRangeStartDateTime(objRangeStartDateTime);
		academicDegreeProgramDateRange.setRangeEndDateTime(objRangeEndDateTime);
		setAcademicDegreeProgramDateRange(academicDegreeProgramDateRange);
	}

	/**
	 * Set the Academic Degree Program Date Range.
	 * This field contains the date range when the academic degree program take place.
	 * @param objAcademicDegreeProgramDateRange Object of Academic Degree Program Date Range.
	 */
	public void setAcademicDegreeProgramDateRange(DR objAcademicDegreeProgramDateRange)
	{
		setDataType(1597,objAcademicDegreeProgramDateRange);

	}

	/**
	 * Set the Academic Degree Program Participation Date Range.
	 * This field contains the date range during which the staff member participated in the 
	 * academic degree program. 
	 * @param objRangeStartDateTime Specifies the earliest date/time (time stamp) in the specified range.
	 * @param objRangeEndDateTime Specifies the latest date/time in the specified range.
	 */	
	public void setAcademicDegreeProgramParticipationDateRange(DTM objRangeStartDateTime, DTM objRangeEndDateTime) 
	{
		DR academicDegreeProgramParticipationDateRange = (DR)getDataElement(1450);
		academicDegreeProgramParticipationDateRange.setRangeStartDateTime(objRangeStartDateTime);
		academicDegreeProgramParticipationDateRange.setRangeEndDateTime(objRangeEndDateTime);
		setAcademicDegreeProgramParticipationDateRange(academicDegreeProgramParticipationDateRange);
	}

	/**
	 * Set the Academic Degree Program Participation Date Range.
	 * This field contains the date range during which the staff member participated in the 
	 * academic degree program. 
	 * @param objAcademicDegreeProgramParticipationDateRange Object of Academic Degree Program Participation Date Range.
	 */
	public void setAcademicDegreeProgramParticipationDateRange(DR objAcademicDegreeProgramParticipationDateRange)
	{
		setDataType(1450,objAcademicDegreeProgramParticipationDateRange);

	}

	/**
	 * Set the Academic Degree Granted Date.
	 * This field contains the date of the academic degree is grant to the staff member.
	 * @param strAcademicDegreeGrantedDate Used for AcademicDegreeGrantedDate.
	 */
	public void setAcademicDegreeGrantedDate(String strAcademicDegreeGrantedDate) 
	{
		DT academicDegreeGrantedDate  = (DT)getDataElement(1451);
		academicDegreeGrantedDate.setValue(strAcademicDegreeGrantedDate);
		setAcademicDegreeGrantedDate(academicDegreeGrantedDate);
	}

	/**
	 * Set the Academic Degree Granted Date.
	 * This field contains the date of the academic degree is grant to the staff member.
	 * @param objAcademicDegreeGrantedDate Object of Academic Degree Granted Date.
	 */
	public void setAcademicDegreeGrantedDate(DT objAcademicDegreeGrantedDate)
	{
		setDataType(1451,objAcademicDegreeGrantedDate);

	}

	/**
	 * Set the School.
	 * This field contains the official name of the academic institution that granted the degree to the Staff Member.
	 * @param strOrganizationName Specifies name of the specified organization.
	 * @param objOrganizationNameTypeCode Specifies a code that represents the type of name i.e., legal name, display name.
	 * 										Suggested Values A,L,D,SL.[Refer to table No.0204]  
	 * @param objAssigningAuthority Specifies The assigning authority is a unique identifier of the system 
	 * 									(or organization or agency or department) that creates the data. 
	 * @param strIdentifierTypeCode Specifies a code corresponding to the type of identifier. 
	 * @param objAssigningFacility Specifies The place or location identifier where the identifier was first assigned to the person. 
	 * @param strNameRepresentationCode Specifies representations of the same name/address Suggested values are I,A,P [Refer table 0465] 
	 * @param strOrganizationIdentifier This component contains the sequence of characters (the code) that uniquely 
	 * 									  identifies the item being referenced by XON.1 Organization Name. 
	 * 									  This component replaces XON.3 ID Number as of v 2.5.
	 */ 	
	public void setSchool (String strOrganizationName, CWE objOrganizationNameTypeCode,
			 HD objAssigningAuthority,
			String strIdentifierTypeCode, HD objAssigningFacility, String strNameRepresentationCode,
			String strOrganizationIdentifier)
	{
		XON xon  = (XON)getDataElement(1452);
		xon.setOrganizationName(strOrganizationName);
		xon.setOrganizationNameTypeCode(objOrganizationNameTypeCode);
		xon.setAssigningAuthority(objAssigningAuthority);
		xon.setIdentifierTypeCode(strIdentifierTypeCode);
		xon.setAssigningFacility(objAssigningFacility);
		xon.setNameRepresentationCode(strNameRepresentationCode);
		xon.setOrganizationIdentifier(strOrganizationIdentifier);
		setSchool(xon);
	}

	/**
	 * Set the School.
	 * This field contains the official name of the academic institution that granted the degree to the Staff Member.
	 * @param objSchool Object of School.
	 */
	public void setSchool(XON objSchool)
	{
		setDataType(1452,objSchool);

	}

	/**
	 * Set the School Type Code.
	 * This field contains the categorization of the academic institution that granted the degree to the Staff Member.       
	 * @param strIdentifier Specifies of characters (the code) that uniquely identifies the item being referenced. 
	 * @param strText Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction. 
	 * @param strNameOfCodingSystem Identifies the coding scheme being used in the identifier component.
	 * @param strAlternateIdentifier Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
	 * @param strAlternateText Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
	 * @param strNameOfAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component. 
	 * @param strCodingSystemVersionID A sequence of characters that uniquely identifies a second alternate code.
	 * @param strAlternateCodingSystemVersionId This component carries the version for the coding system identified by components 4-6.
	 * @param strOriginalText The text as seen and/or selected by the user who entered the data.
	 * @param strSecondAlternateIdentifier A sequence of characters that uniquely identifies a second alternate code.
	 * @param strSecondAlternateText The descriptive or textual name of the alternate identifier.
	 * @param strNameofSecondAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component.
	 * @param strSecondAlternateCodingSystemVersionID This component carries the version for the coding system identified by components 10-12.
	 * @param strCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
	 * @param strValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
	 * @param strValueSetVersionID This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
	 * @param strAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
	 * @param strAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
	 * @param strAlternateValueSetVersionID This component carries the version for the value set identified by CWE.18. The version is a date.
	 * @param strSecondAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
	 * @param strSecondAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
	 * @param strSecondAlternateValueSetVersionID This component carries the version for the value set identified by CWE.21. The version is a date.
	 */
	public void setSchoolTypeCode(String strIdentifier,String strText,String strNameOfCodingSystem,
			String strAlternateIdentifier,String strAlternateText,String strNameOfAlternateCodingSystem, String strCodingSystemVersionID, String 				strAlternateCodingSystemVersionId,
			String strOriginalText, String  strSecondAlternateIdentifier, String strSecondAlternateText, 
			String strNameofSecondAlternateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, String strValueSetOID,
			String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID, String strAlternateValueSetVersionID,
			String  strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID, String strSecondAlternateValueSetVersionID)
	{
		CWE cwe  = (CWE)getDataElement(1453);
		cwe.setIdentifier(strIdentifier);
		cwe.setText(strText);
		cwe.setNameOfCodingSystem(strNameOfCodingSystem);
		cwe.setAlternateIdentifier(strAlternateIdentifier);
		cwe.setAlternateText(strAlternateText);
		cwe.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		cwe.setCodingSystemVersionID(strCodingSystemVersionID);
		cwe.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		cwe.setOriginalText(strOriginalText);
		cwe.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cwe.setSecondAlternateText(strSecondAlternateText);
		cwe.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		cwe.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cwe.setCodingSystemOID(strCodingSystemOID);
		cwe.setValueSetOID(strValueSetOID);
		cwe.setValueSetVersionID(strValueSetVersionID);
		cwe.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cwe.setAlternateValueSetOID(strAlternateValueSetOID);
		cwe.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cwe.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cwe.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cwe.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		setSchoolTypeCode(cwe);
	}

	/**
	 * Set the School Type Code.
	 * This field contains the categorization of the academic institution that granted the degree to the Staff Member.
	 * @param objSchoolTypeCode Object of School Type Code.
	 */
	public void setSchoolTypeCode(CWE objSchoolTypeCode)
	{
		setDataType(1453,objSchoolTypeCode);

	}

	/**
	 * Set the School Address.
	 * This field contains the postal address of the academic institution that granted the degree to the Staff Member.
	 * @param objStreetAddress Specifies the street address.
	 * @param strOtherDesignation Specifies the Second line of address. 
	 * @param strCity The city, or district or place where the addressee is located. 
	 * @param strStateOrProvince Specifies the state or province where the addressee is located.
	 * @param strZipOrPostalCode Specifies the zip or postal code where the addressee is located. 
	 * @param strCountry Specifies the country where the addressee is located.
	 * @param strAddressType Specifies the kind or type of address.
	 * @param strOtherGeographicDesignation Specifies any other geographic designation. 
	 * @param objCountyParishCode Specifies a code that represents the county in which the specified address resides. 
	 * @param objCensusTract Specifies a code that represents the census tract in which the specified address resides. 
	 * @param strAddressRepresentationCode Specifies representations of the same name/address Suggested values are I,A,P [Refer table 0465]
	 * @param objEffectiveDate It is The first date, if known, on which the address is valid and active.
	 * @param objExpirationDate It is The last date, if known, on which the address is valid and active.
	 * @param objExpirationReason indicates why this address was marked as ended.
	 * @param strTemporaryIndicator indicates whether address is considered temporary .
	 * @param strBadAddressIndicator indicates whether it is possible to contact the owning entity.
	 * @param strAddressUsage indicates how the address is intended to be used.
	 * @param strAddressee indicates the name of the person whose address is intended to be used.
	 * @param strComment indicated descriptive information
	 * @param strPreferenceOrder preference order
	 * @param objProtectionCode indicates that an address need to be protected
	 * @param objAddressIdentifier indicates a unique identifier for address
	 */ 	
	public void setSchoolAddress(SAD objStreetAddress,String strOtherDesignation,String strCity,
			String strStateOrProvince,String strZipOrPostalCode,String strCountry,String strAddressType,
			String strOtherGeographicDesignation,CWE objCountyParishCode,CWE objCensusTract,
			String strAddressRepresentationCode,DTM objEffectiveDate,
			DTM objExpirationDate, CWE objEXpirationReason, String strTemporaryIndicator,
			String strBadAddressIndicator, String strAddressUsage, String strAddressee, String strComment,
			String strPreferenceOrder, CWE objProtectionCode, EI objAddressIdentifier)
	{
		XAD xad = (XAD)getDataElement(1454);
		xad.setStreetAddress(objStreetAddress);
		xad.setOtherDesignation(strOtherDesignation);
		xad.setCity(strCity);
		xad.setStateOrProvince(strStateOrProvince);
		xad.setZipOrPostalCode(strZipOrPostalCode);
		xad.setCountry(strCountry);
		xad.setAddressType(strAddressType);
		xad.setOtherGeographicDesignation(strOtherGeographicDesignation);
		xad.setCountyParishCode(objCountyParishCode);
		xad.setCensusTract(objCensusTract);
		xad.setAddressRepresentationCode(strAddressRepresentationCode);
 
		xad.setEffectiveDate(objEffectiveDate);
		xad.setExpirationDate(objExpirationDate); 
		xad.setExpirationReason(objEXpirationReason);
		xad.setTemporaryIndicator(strTemporaryIndicator);
		xad.setBadAddressIndicator(strBadAddressIndicator);
		xad.setAddressUsage(strAddressUsage);
		xad.setAddressee(strAddressee);
		xad.setComment(strComment);
		xad.setPreferenceOrder(strPreferenceOrder);
		xad.setProtectionCode(objProtectionCode);
		xad.setAddressIdentifier(objAddressIdentifier);
		setSchoolAddress(xad);
	}

	/**
	 * Set the School Address.
	 * This field contains the postal address of the academic institution that granted the degree to the Staff Member.
	 * @param objSchoolAddress Object of School Address. 
	 */
	public void setSchoolAddress(XAD objSchoolAddress)
	{ 
		setDataType(1454,objSchoolAddress);

	}

	/**
	 * Add the Major Field of Study.
	 * This field contains the subject of academic study associated with the specific 
	 * academic degree program pursued by the staff member as his/her area of specialization.     
	 * @param strIdentifier Specifies of characters (the code) that uniquely identifies the item being referenced. 
	 * @param strText Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction. 
	 * @param strNameOfCodingSystem Identifies the coding scheme being used in the identifier component.
	 * @param strAlternateIdentifier Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
	 * @param strAlternateText Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
	 * @param strNameOfAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component. 
	 * @param strCodingSystemVersionID A sequence of characters that uniquely identifies a second alternate code.
	 * @param strAlternateCodingSystemVersionId This component carries the version for the coding system identified by components 4-6.
	 * @param strOriginalText The text as seen and/or selected by the user who entered the data.
	 * @param strSecondAlternateIdentifier A sequence of characters that uniquely identifies a second alternate code.
	 * @param strSecondAlternateText The descriptive or textual name of the alternate identifier.
	 * @param strNameofSecondAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component.
	 * @param strSecondAlternateCodingSystemVersionID This component carries the version for the coding system identified by components 10-12.
	 * @param strCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
	 * @param strValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
	 * @param strValueSetVersionID This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
	 * @param strAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
	 * @param strAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
	 * @param strAlternateValueSetVersionID This component carries the version for the value set identified by CWE.18. The version is a date.
	 * @param strSecondAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
	 * @param strSecondAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
	 * @param strSecondAlternateValueSetVersionID This component carries the version for the value set identified by CWE.21. The version is a date.
	 */	
	public void addMajorFieldofStudy(String strIdentifier,String strText,String strNameOfCodingSystem,
			String strAlternateIdentifier,String strAlternateText,String strNameOfAlternateCodingSystem, String strCodingSystemVersionID, String strAlternateCodingSystemVersionId,
			String strOriginalText, String  strSecondAlternateIdentifier, String strSecondAlternateText, 
			String strNameofSecondAlternateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, String strValueSetOID,
			String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID, String strAlternateValueSetVersionID,
			String  strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID, String strSecondAlternateValueSetVersionID)
	{
		CWE cwe  = (CWE)getDataElement(1885);
		cwe.setIdentifier(strIdentifier);
		cwe.setText(strText);
		cwe.setNameOfCodingSystem(strNameOfCodingSystem);
		cwe.setAlternateIdentifier(strAlternateIdentifier);
		cwe.setAlternateText(strAlternateText);
		cwe.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		cwe.setCodingSystemVersionID(strCodingSystemVersionID);
		cwe.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		cwe.setOriginalText(strOriginalText);
		cwe.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cwe.setSecondAlternateText(strSecondAlternateText);
		cwe.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		cwe.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cwe.setCodingSystemOID(strCodingSystemOID);
		cwe.setValueSetOID(strValueSetOID);
		cwe.setValueSetVersionID(strValueSetVersionID);
		cwe.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cwe.setAlternateValueSetOID(strAlternateValueSetOID);
		cwe.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cwe.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cwe.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cwe.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		addMajorFieldofStudy(cwe);
	}

	/**
	 * Add the Major Field of Study.
	 * This field contains the subject of academic study associated with the specific 
	 * academic degree program pursued by the staff member as his/her area of specialization.
	 * @param objMajorFieldofStudy Object of Major Field of Study.
	 */
	public void addMajorFieldofStudy(CWE objMajorFieldofStudy)
	{
		addDataType(1885,objMajorFieldofStudy);
	}

	/**
	 * Add the Major Field of Study.
	 * This field contains the subject of academic study associated with the specific 
	 * academic degree program pursued by the staff member as his/her area of specialization.
	 * @param objMajorFieldofStudyList List of Major Field of Study.
	 */
	@SuppressWarnings("unchecked")
	public void setMajorFieldofStudy(ISingleCollection<CWE> objMajorFieldofStudyList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objMajorFieldofStudyList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1885,objCollection);
	}

	/**
	 * Validates HL7 Message objects .
	 * Validate method checks for validation each and every segments in side the Message object against specified message Structure. 
	 * Validation checks include optionality of segment or group.
	 * It also verifies the number of times segment or group is repeated in message.
	 * e.g 
	 * {PSH} while parsing PSH segment validate method will check for its mandatory presence.
	 * [PSH] in this case validate will throw exception if one tries to enter more than one PSH segment.
	 * @return boolean - true or false.
	 * @throws InvalidSegmentException Throws when Segment Validation fails. 
	 */
	@Override
	public boolean validate() throws InvalidSegmentException 
	{
		try
		{	
			/*
			 * SetID_EDU is required field of this segment.
			 */
			super.validate();

			return true;
		}
		catch(FieldMissingException ex)
		{
			throw new InvalidSegmentException(enumSegments.getValue(),ex);
		}
	}
}