/*******************************************************************************
 *  Copyright 2017 Center 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.DTM;
import cdac.medinfo.sdk.hl7282.baselibs.EI;
import cdac.medinfo.sdk.hl7282.baselibs.FN;
import cdac.medinfo.sdk.hl7282.baselibs.HD;
import cdac.medinfo.sdk.hl7282.baselibs.ID;
import cdac.medinfo.sdk.hl7282.baselibs.NM;
import cdac.medinfo.sdk.hl7282.baselibs.SAD;
import cdac.medinfo.sdk.hl7282.baselibs.ST;
import cdac.medinfo.sdk.hl7282.baselibs.XAD;
import cdac.medinfo.sdk.hl7282.baselibs.XCN;
import cdac.medinfo.sdk.hl7282.commoninterface.IDataType;
import cdac.medinfo.sdk.hl7282.commoninterface.ISingleCollection;
import cdac.medinfo.sdk.hl7282.exceptions.InvalidSegmentException;
import cdac.medinfo.sdk.hl7282.utils.EnumSegments;
import cdac.medinfo.sdk.hl7282.utils.SingleCollection;

/**
 * ACC - Accident Segment<p>
 * The Class represents,ACC segment which contains patient information relative to an
 * accident in which the patient has been involved.
 * <p>Represents an HL7 ACC message segment. 
 * This segment has the following fields:</p><p>
 * ACC-1: Accident Date/Time (DTM)<b>Optional</b><br> 
 * ACC-2: Accident Code (CWE)<b>Optional</b><br> 
 * ACC-3: Accident Location (ST)<b>Optional</b><br> 
 * ACC-4: Auto Accident State (CWE)<b>Backward</b><br> 
 * ACC-5: Accident Job Related Indicator (ID)<b>Optional</b><br> 
 * ACC-6: Accident Death Indicator (ID)<b>Optional</b><br> 
 * ACC-7: Entered By (XCN)<b>Optional</b><br> 
 * ACC-8: Accident Description (ST)<b>Optional</b><br> 
 * ACC-9: Brought In By (ST)<b>Optional</b><br> 
 * ACC-10: Police Notified Indicator (ID)<b>Optional</b><br> 
 * ACC-11: Accident Address (XAD)<b>Optional</b><br>
 * ACC-12: Degree of patient liability (NM)<b>Optional</b><br> 
 * ACC-13: Accident Identifier (EI)<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 ACC extends Segment   
{
	

	/**
	 * Constructs the ACC segment.
	 */
	public ACC()
	{super(EnumSegments.HL7_SEG_ACC);
	}

	/**
	 * Retrieves the Accident Address.
	 * @return XAD - accidentAddress
	 */
	public XAD getAccidentAddress() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1853);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (XAD)objDataCollection.elementAt(0);
		else
			return null;
	}


	/**
	 * Retrieves the Accident Code.
	 * @return CWE - accidentCode
	 */
	public CWE getAccidentCode() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(528);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}


	/**
	 * Retrieves the Accident Date Or Time.
	 * @return DTM - accidentDateOrTime
	 */
	public DTM getAccidentDateOrTime() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(527);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Accident Death Indicator.
	 * This field which indicates whether or not a patient has died as a result of an accident.
	 * @return String - accidentDeathIndicator
	 */
	public ID getAccidentDeathIndicator() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(814);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Accident Description./
	 * @return String - accidentDescription
	 */
	public ST getAccidentDescription() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1503);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Accident Job Related Indicator.
	 * This field indicates if the accident is related to a job.
	 * @return String - accidentJobRelatedIndicator
	 */
	public ID getAccidentJobRelatedIndicator() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(813);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Accident Location.
	 * @return String - accidentLocation
	 */
	public ST getAccidentLocation() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(529);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	/**
	 * Retrieves the Auto Accident State.
	 * This field specify the state in which the auto accident occurred.
	 * @return CWE - autoAccidentState
	 */
	public CWE getAutoAccidentState() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(812);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Brought In By.
	 * This field is for the person or organization that brought in the patient.
	 * @return String - broughtInBy
	 */
	public ST getBroughtInBy() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1504);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Entered By.
	 * @return XCN - enteredBy
	 */
	public XCN getEnteredBy() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(224);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (XCN)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Police Notified Indicator.
	 * This field indicates the police were notified.
	 * @return String - policeNotifiedIndicator
	 */
	public ID getPoliceNotifiedIndicator() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1505);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Retrieves the Degree of patient liability.
	 * This field conveys the amount to which the patient is found to be liable for an accident. The numeric value is given as a percentage value.
	 * @return NM - DegreeOfPatientLiability
	 */
	public NM getDegreeOfPatientLiability()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(458);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (NM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * @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 setAccidentCode (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(528);
		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);
		setAccidentCode (cwe);
	}

	/**
	 * Set the Accident Code.  
	 * @param accidentCode Accident Code
	 */
	public void setAccidentCode(CWE accidentCode)
	{
		setDataType(528,accidentCode);
	}

	/**
	 * Set the Accident Date Or Time.
	 * @param strTime Specifies a point in time using a 24-hour clock notation. 
	 */
	public void setAccidentDateOrTime (String strTime) 
	{
		DTM accidentDateOrTime  = (DTM)getDataElement(527);
		accidentDateOrTime.setValue(strTime);
		setAccidentDateOrTime (accidentDateOrTime);
	}

	/**
	 * Set the Accident Date Or Time.
	 * @param accidentDateOrTime Accident Date Or Time
	 */
	public void setAccidentDateOrTime(DTM accidentDateOrTime)
	{
		setDataType(527,accidentDateOrTime);
	}

	/**
	 * Set the Accident Death Indicator.
	 * This field which indicates whether or not a patient has died as a result of an accident.
	 * @param strAccidentDeathIndicator Used as AccidentDeathIndicator
	 */
	public void setAccidentDeathIndicator (String strAccidentDeathIndicator) 
	{
		ID accidentDeathIndicator  = (ID)getDataElement(814);
		accidentDeathIndicator.setValue(strAccidentDeathIndicator);
		setAccidentDeathIndicator (accidentDeathIndicator);
	}

	/**
	 * Set the Accident Death Indicator.
	 * This field which indicates whether or not a patient has died as a result of an accident.
	 * @param accidentDeathIndicator Used as AccidentDeathIndicator
	 */
	public void setAccidentDeathIndicator(ID accidentDeathIndicator)
	{
		setDataType(814,accidentDeathIndicator);
	}

	/**
	 * Set the Accident Description.
	 * @param strAccidentDecription Used as AccidentDeathIndicator
	 */
	public void setAccidentDescription (String strAccidentDecription) 
	{
		ST accidentDescription  = (ST)getDataElement(1503);
		accidentDescription.setValue(strAccidentDecription);
		setAccidentDescription (accidentDescription);
	}

	/**
	 * Set the Accident Description.
	 * @param accidentDescription Used as AccidentDeathIndicator
	 */
	public void setAccidentDescription(ST accidentDescription)
	{
		setDataType(1503,accidentDescription);
	}

	/**
	 * Set the Accident Job Related Indicator.
	 * This field indicates if the accident is related to a job.
	 * @param strAccidentJobRelatedIndicator Used as AccidentJobRelatedIndicator
	 */
	public void setAccidentJobRelatedIndicator (String strAccidentJobRelatedIndicator) 
	{
		ID accidentJobRelatedIndicator  = (ID)getDataElement(813);
		accidentJobRelatedIndicator.setValue(strAccidentJobRelatedIndicator);
		setAccidentJobRelatedIndicator (accidentJobRelatedIndicator);
	}

	/**
	 * Set the Accident Job Related Indicator.
	 * This field indicates if the accident is related to a job.
	 * @param accidentJobRelatedIndicator Used as AccidentJobRelatedIndicator
	 */
	public void setAccidentJobRelatedIndicator(ID accidentJobRelatedIndicator)
	{
		setDataType(813,accidentJobRelatedIndicator);
	}

	/**
	 * Set the Accident Location.
	 * @param strAccidentLocation Used as AccidentLocation.
	 */
	public void setAccidentLocation (String strAccidentLocation) 
	{
		ST accidentLocation  = (ST)getDataElement(529);
		accidentLocation.setValue(strAccidentLocation);
		setAccidentLocation (accidentLocation);
	}

	/**
	 * Set the Accident Location.
	 * @param accidentLocation Used as AccidentLocation.
	 */
	public void setAccidentLocation(ST accidentLocation)
	{
		setDataType(529,accidentLocation);
	}

	/**
	 * Set the Auto Accident State.
	 * This field specify the state in which the auto accident occurred.  
	 * @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 setAutoAccidentState (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(812);
		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);
		setAutoAccidentState (cwe);

	}

	/**
	 * Set the Auto Accident State.
	 * This field specify the state in which the auto accident occurred.  
	 * @param autoAccidentState Auto Accident State
	 */
	public void setAutoAccidentState(CWE autoAccidentState)
	{
		setDataType(812,autoAccidentState);
	}

	/**
	 * Set the Brought In By.
	 * This field is for the person or organization that brought in the patient.
	 * @param strBroughtInBy Used as BroughtInBy
	 */
	public void setBroughtInBy (String strBroughtInBy) 
	{
		ST broughtInBy  = (ST)getDataElement(1504);
		broughtInBy.setValue(strBroughtInBy);
		setBroughtInBy (broughtInBy);
	}

	/**
	 * Set the Brought In By.
	 * This field is for the person or organization that brought in the patient.
	 * @param broughtInBy Used as BroughtInBy
	 */
	public void setBroughtInBy(ST broughtInBy)
	{
		setDataType(1504,broughtInBy);
	}

	/**
	 * Set the Entered By.
	 * @param strIDNumber Refers to the coded ID according to a user-defined table
	 * @param objFamilyName Specifies the surname of a person.
	 * @param strGivenName Specifies First name.
	 * @param strSecondAndFurtherGivenNamesOrInitialsThereof Specifies multiple middle names that may be included by 
	 * 														   separating them with spaces.
	 * @param strSuffix Used to specify a name suffix (e.g., Jr. or III).
	 * @param strPrefix Used to specify a name prefix (e.g., Dr.).
	 * @param strSourceTable Used as the HL7 identifier for the user-defined table of values for this component. [Refer User-defined Table 0297 - CN ID.]
	 * @param objAssigningAuthority Specifies a unique identifier of the system (or organization or agency of department)
	 * 								  that creates the data. [Refer User-defined Table 0363 - Assigning authority]
	 * @param strNameTypeCode Specifies a code that represents the type of name. 
	 * @param strIdentifierCheckDigit Specifies part of the identifying number used in the sending application. 
	 * @param strCheckDigitScheme Specifies the code identifying the check digit scheme employed.[Refer HL7 Table 0061 - Check digit scheme].
	 * @param strIdentifierTypeCode Specifies A code corresponding to the type of identifier.[Refer HL7 Table 0203 - Identifier type].
	 * @param objAssigningFacility Specifies the place or location identifier where the identifier was first assigned to the person
	 * @param strNameRepresentationCode Provides an indication of the representation provided by the data item.  
	 * @param objNameContext Designates the context in which a name is used. [Refer User-defined Table 0448 ]
	 * @param strNameAssemblyOrder Specifies a code that represents the preferred display order of the components of this person name. Suggested values are G,F[Refer table 0444.]
	 * @param strEffectiveDate Specifies the first date, if known, on which the address is valid and active.
	 * @param strExpirationDate Specifies the last date, if known, on which the address is valid and active.
	 * @param strProfessionalSuffix Used to specify an abbreviation, or a string of abbreviations, denoting qualifications that support the person's profession, (e.g., licenses).
	 * @param objAssigningJurisdiction Specifies the geo-political body that assigned the identifier.
	 * @param objAssigningAgencyOrDepratment Specifies the agency or department that assigned the identifier
	 * @param strSecurityCheck Specifies the version code that may be assigned to the person identifier
	 * @param strSecurityCheckScheme Specifies the check digit scheme.
	 */
	public void setEnteredBy (String strIDNumber,FN objFamilyName,String strGivenName,String strSecondAndFurtherGivenNamesOrInitialsThereof,
			String 	strSuffix,String strPrefix,CWE objSourceTable,HD objAssigningAuthority,
			String strNameTypeCode,String strIdentifierCheckDigit,String strCheckDigitScheme,String strIdentifierTypeCode,
			HD objAssigningFacility,String strNameRepresentationCode,CWE objNameContext,
			String strNameAssemblyOrder, String strEffectiveDate,String strExpirationDate,String strProfessionalSuffix,
			CWE objAssigningJurisdiction,CWE objAssigningAgencyOrDepratment, String strSecurityCheck, String strSecurityCheckScheme)
	{
		XCN xcn  = (XCN)getDataElement(224);
		xcn.setIdNumber(strIDNumber);
		xcn.setFamilyName(objFamilyName);
		xcn.setGivenName(strGivenName);
		xcn.setSecondNameOrInitials(strSecondAndFurtherGivenNamesOrInitialsThereof);
		xcn.setSuffix(strSuffix);
		xcn.setPrefix(strPrefix);
 
		xcn.setSourceTable(objSourceTable);
		xcn.setAssigningAuthority(objAssigningAuthority);
		xcn.setNameTypeCode(strNameTypeCode);
		xcn.setIdentifierCheckDigit(strIdentifierCheckDigit);
		xcn.setCheckDigitScheme(strCheckDigitScheme);
		xcn.setIdentifierTypeCode(strIdentifierTypeCode);
		xcn.setAssigningFacility(objAssigningFacility);
		xcn.setNameRepresentationCode(strNameRepresentationCode);
		xcn.setNameContext(objNameContext);
 
		xcn.setNameAssemblyOrder(strNameAssemblyOrder);
		xcn.setEffectiveDate(strEffectiveDate);
		xcn.setExpirationDate(strExpirationDate);
		xcn.setProfessionalSuffix(strProfessionalSuffix);
		xcn.setAssigningJurisdiction(objAssigningJurisdiction);
		xcn.setAssigningAgencyOrDepartment(objAssigningAgencyOrDepratment); 
		xcn.setSecurityCheck(strSecurityCheck);
		xcn.setSecurityCheckScheme(strSecurityCheckScheme);
		setEnteredBy (xcn);

	}

	/**
	 * Set the Entered By.
	 * @param enteredBy Entered By.
	 */
	public void setEnteredBy(XCN enteredBy)
	{
		setDataType(224,enteredBy);
	}

	/**
	 * Set the Police Notified Indicator.
	 * This field indicates the police were notified.
	 * @param strPoloceNotifiedIndicator Used as PoloceNotifiedIndicator
	 */
	public void setPoliceNotifiedIndicator (String strPoloceNotifiedIndicator) 
	{
		ID policeNotifiedIndicator  = (ID)getDataElement(1505);
		policeNotifiedIndicator.setValue(strPoloceNotifiedIndicator);
		setPoliceNotifiedIndicator (policeNotifiedIndicator);
	}

	/**
	 * Set the Police Notified Indicator.
	 * This field indicates the police were notified.
	 * @param policeNotifiedIndicator Used as PoloceNotifiedIndicator
	 */
	public void setPoliceNotifiedIndicator(ID policeNotifiedIndicator)
	{
		setDataType(1505,policeNotifiedIndicator);
	}

	/**
	 * Set the Accident Address.
	 * @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 objAdressIdentifier indicates a unique identifier for address
	 */
	public void setAccidentAddress (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(1853);
		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);	
		setAccidentAddress (xad);
	}

	/**
	 * Set the Accident Address.
	 * @param accidentAddress Accident Address
	 */
	public void setAccidentAddress(XAD accidentAddress)
	{
		setDataType(1853,accidentAddress);
	}
	
	/** 
	 * Set the Degree of patient liability.
	 * This field conveys the amount to which the patient is found to be liable for an accident. The numeric value is given as a percentage value.
	 * @param strDegreeOfPatientLiability Degree of patient liability
	 */ 
	public void setDegreeOfPatientLiability (String strDegreeOfPatientLiability)  
	{
		NM DegreeOfPatientLiability  = (NM)getDataElement(458);
		DegreeOfPatientLiability.setValue(strDegreeOfPatientLiability); 
		setDegreeOfPatientLiability(DegreeOfPatientLiability);

	} 

	/** Set the Degree of patient liability.
	 * This field conveys the amount to which the patient is found to be liable for an accident. The numeric value is given as a percentage value.
	 * @param objDegreeOfPatientLiability Degree of patient liability
	 */ 
	public void setDegreeOfPatientLiability(NM objDegreeOfPatientLiability)
	{
		setDataType(458,objDegreeOfPatientLiability);

	}
	
	/**
	 * Retrieves the Degree of patient liability.
	 * This field conveys the amount to which the patient is found to be liable for an accident. The numeric value is given as a percentage value. 
	 * @return NM - DegreeOfPatientliability
	 */
	public NM getDegreeOfPatientliability() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2374);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (NM)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set the Degree of patient liability.
	 * This field conveys the amount to which the patient is found to be liable for an accident. The numeric value is given as a percentage value. 
	 * @param strAmount This field contains the String Value of Amount.
	 */ 
	public void setDegreeOfPatientliability (String strAmount) 
	{
		NM DegreeOfPatientliability  = (NM)getDataElement(2374);
		DegreeOfPatientliability.setValue(strAmount); 
		setDegreeOfPatientliability(DegreeOfPatientliability);

	} 

	/** 
	 * Set the Degree of patient liability.
	 * This field conveys the amount to which the patient is found to be liable for an accident. The numeric value is given as a percentage value. 
	 * @param objDegreeOfPatientliability Object of Degree of patient liability.
	 */ 
	public void setDegreeOfPatientliability(NM objDegreeOfPatientliability)
	{
		setDataType(2374,objDegreeOfPatientliability);

	}
	
	/**
	 * Retrieves the Accident Identifier.
	 * This field contains the identifier of the accident report assigned by a jurisdiction that is required in the insurance accident claim. 
	 * @return ISingleCollection<EI> - AccidentIdentifier
	 */
	public ISingleCollection<EI> getAccidentIdentifier() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(3338);
		ISingleCollection<EI> objDataList = new SingleCollection<EI>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				EI objEI = (EI)objDataType;
				objDataList.add(objEI);
			}
		}
		return objDataList;
	}
	
	/**
	 * Add the Accident Identifier.
	 * This field contains the identifier of the accident report assigned by a jurisdiction that is required in the insurance accident claim. 
	 * @param strEntityIdentifier Specifies defined by a hierarchic designator, represented by components 2 through 4.
	 * 								[Reference Section 2.A.33, "HD - hierarchic designator".] 
	 * @param strNamespaceId Specifies  the HL7 identifier for the user-defined table of values for this component.
	 * 						   [Refer to User-defined Table 0363 - Assigning authority] 	 
	 * @param strUniversalId Specifies string formatted according to the scheme defined by the component, 
	 * 							<universal ID type> (UID type). 
	 * @param strUniversalIdType Specifies  the interpretation of the second component of the HD. 
	 */ 
	public void addAccidentIdentifier (String strEntityIdentifier,String strNamespaceId,
			String strUniversalId,String strUniversalIdType)
	{
		EI AccidentIdentifier  = (EI)getDataElement(3338);
		AccidentIdentifier.setEntityIdentifier(strEntityIdentifier);
		AccidentIdentifier.setNamespaceId(strNamespaceId);
		AccidentIdentifier.setUniversalId(strUniversalId);
		AccidentIdentifier.setUniversalIdType(strUniversalIdType); 
		addAccidentIdentifier(AccidentIdentifier);

	} 

	/** 
	 * Add the Accident Identifier.
	 * This field contains the identifier of the accident report assigned by a jurisdiction that is required in the insurance accident claim. 
	 * @param objAccidentIdentifier Object of Accident Identifier. 
	 */ 
	public void addAccidentIdentifier(EI objAccidentIdentifier)
	{
		addDataType(3338,objAccidentIdentifier);

	} 

	/** 
	 * Set the Accident Identifier.
	 * @param objAccidentIdentifierList List of Accident Identifier. 
	 */ 
	@SuppressWarnings("unchecked")
	public void setAccidentIdentifier(ISingleCollection<EI> objAccidentIdentifierList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objAccidentIdentifierList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(3338,objCollection);
	}

	/**
	 * Validates HL7 Message objects .
	 * Validate method checks for validation each and every segments in side the Message object against specified message Structure. 
	 * Validation chcecks 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 If Segment Validation fails
	 */
	public boolean validate()throws InvalidSegmentException
	{
		//All fields are optional
		//This Segment Supports Feature Modes For Updating via Repeating Segment.
		//Validation Mode for this segments validation doesn't affect.
		super.validate();
		return true;
	}
}