/*******************************************************************************
 *  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.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.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.baselibs.XTN;
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;

/**
 * FAC - Facility Segment<p>
 * <p>Represents an HL7 FAC message segment. 
 * This segment has the following fields:</p><p>
 * FAC-1: Facility ID-FAC (EI)<b>Required</b><br> 
 * FAC-2: Facility Type (ID)<b>Optional</b><br> 
 * FAC-3: Facility Address (XAD)<b>Required</b><br> 
 * FAC-4: Facility Telecommunication (XTN)<b>Required</b><br> 
 * FAC-5: Contact Person (XCN)<b>Optional</b><br> 
 * FAC-6: Contact Title (ST)<b>Optional</b><br> 
 * FAC-7: Contact Address (XAD)<b>Optional</b><br> 
 * FAC-8: Contact Telecommunication (XTN)<b>Optional</b><br> 
 * FAC-9: Signature Authority (XCN)<b>Required</b><br> 
 * FAC-10: Signature Authority Title (ST)<b>Optional</b><br> 
 * FAC-11: Signature Authority Address (XAD)<b>Optional</b><br> 
 * FAC-12: Signature Authority Telecommunication (XTN)<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 FAC extends Segment    
{
	

	/**
	 * Constructs the FAC segment.
	 */
	public FAC()
	{super(EnumSegments.HL7_SEG_FAC);
	}

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

	/**
	 * Retrieves the Contact Address,.
	 * This field contains the primary contact person's address.
	 * @return ISingleCollection<XAD> - contactAddress
	 */
	public ISingleCollection<XAD> getContactAddress() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1166);
		ISingleCollection<XAD> objDataList = new SingleCollection<XAD>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				XAD objXAD = (XAD)objDataType;
				objDataList.add(objXAD);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Contact Person.
	 * This field contains the primary contact person's name.	
	 * @return ISingleCollection<XCN> - contactPerson
	 */
	public ISingleCollection<XCN> getContactPerson() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1266);
		ISingleCollection<XCN> objDataList = new SingleCollection<XCN>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				XCN objXCN = (XCN)objDataType;
				objDataList.add(objXCN);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Contact Telecommunication.
	 * This field contains the primary contact person's telecommunication information.
	 * @return ISingleCollection<XTN> - contactTelecommunication
	 */
	public ISingleCollection<XTN> getContactTelecommunication() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1269);
		ISingleCollection<XTN> objDataList = new SingleCollection<XTN>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				XTN objXTN = (XTN)objDataType;
				objDataList.add(objXTN);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Contact Title.
	 * This field contains the primary contact person's title.
	 * @return ISingleCollection<ST> - contactTitle
	 */
	public ISingleCollection<ST> getContactTitle() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1267);
		ISingleCollection<ST> objDataList = new SingleCollection<ST>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				ST objST = (ST)objDataType;
				objDataList.add(objST);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Facility Address.
	 * This field contains the facility's address.
	 * @return ISingleCollection<XAD> - facilityAddress
	 */
	public ISingleCollection<XAD> getFacilityAddress() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1264);
		ISingleCollection<XAD> objDataList = new SingleCollection<XAD>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				XAD objXAD = (XAD)objDataType;
				objDataList.add(objXAD);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Facility ID FAC.
	 * This field contains the facility identifier.
	 * @return EI - facilityID_FAC
	 */
	public EI getFacilityID_FAC() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1262);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (EI)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Facility Telecommunication.
	 * This field contains the facility's telecommunication information.
	 * @return XTN - facilityTelecommunication
	 */
	public XTN getFacilityTelecommunication() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1265);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (XTN)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Facility Type.
	 * This field contains the type of facility.  
	 * @return ID - facilityType
	 */
	public ID getFacilityType() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1263);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Signature Authority.
	 * This field contains the name of the individual with signature authority 
	 * or who is responsible for the report.
	 * @return ISingleCollection<XCN> - signatureAuthority
	 */
	public ISingleCollection<XCN> getSignatureAuthority() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1270);
		ISingleCollection<XCN> objDataList = new SingleCollection<XCN>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				XCN objXCN = (XCN)objDataType;
				objDataList.add(objXCN);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Signature Authority Address.
	 * This field contains the address of the individual with signature authority or who is
	 *  responsible for this report.
	 * @return ISingleCollection<XAD> - signatureAuthorityAddress
	 */
	public ISingleCollection<XAD> getSignatureAuthorityAddress() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1272);
		ISingleCollection<XAD> objDataList = new SingleCollection<XAD>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				XAD objXAD = (XAD)objDataType;
				objDataList.add(objXAD);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Signature Authority Telecommunication.
	 * This field contains the telecommunication information of the 
	 * individual with signature authority of who is responsible for this report.
	 * @return XTN - signatureAuthorityTelecommunication
	 */
	public XTN getSignatureAuthorityTelecommunication() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1273);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (XTN)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Signature Authority Title.
	 * This field contains the address of the individual with signature authority or who is responsible for this report.
	 * @return ST - signatureAuthorityTitle
	 */
	public ST getSignatureAuthorityTitle() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1271);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Add the Contact Address,.
	 * This field contains the primary contact person's 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 addContactAddress (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(1166);
		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);
		addContactAddress(xad);

	} 

	/** 
	 * Add the Contact Address.
	 * This field contains the primary contact person's address.
	 * @param objcontactAddress Object of Contact Address.
	 */ 
	public void addContactAddress(XAD objcontactAddress)
	{
		addDataType(1166,objcontactAddress);

	} 

	/** 
	 * Set the Contact Address.
	 * This field contains the primary contact person's address.
	 * @param objcontactAddressList List of Contact Address.
	 */ 
	@SuppressWarnings("unchecked")
	public void setContactAddress(ISingleCollection<XAD> objcontactAddressList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objcontactAddressList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1166,objCollection);
	}

	/**
	 * Add the Contact Person.
	 * This field contains the primary contact person's name.	
	 * @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 addContactPerson (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(1266);
		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);
		addContactPerson(xcn);

	} 

	/** 
	 * Add the Contact Person.
	 * This field contains the primary contact person's name.
	 * @param objcontactPerson Object of Contact Person.
	 */ 
	public void addContactPerson(XCN objcontactPerson)
	{
		addDataType(1266,objcontactPerson);

	} 

	/** 
	 * Set the Contact Person.
	 * This field contains the primary contact person's name.
	 * @param objcontactPersonList List of Contact Person.
	 */ 
	@SuppressWarnings("unchecked")
	public void setContactPerson(ISingleCollection<XCN> objcontactPersonList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objcontactPersonList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1266,objCollection);
	}

	/**
	 * Add the Contact Telecommunication.
	 * This field contains the primary contact person's telecommunication information.
	 * @param strTeleCommunicationUseCode Specifies a code that represents a specific use of a telecommunication number.
	 										Suggested values are PRN,ORN,WPN,VHN,ASN,EMR,NET,BPN  [Refer table 0201.]
	 * @param strTeleCommunicationEquipmentType Specifies a code that represents the type of telecommunication equipment.
	 * 											  Suggested values are PH,FX,MD,CP,BP,Internet,X.400,TDD,TTY  [Refer table 0202.]
	 * @param strCommuinicationAddress Specifies Email address.
	 * @param strCountryCode Specifies the Country code.
	 * @param strAreaCityCode Specifies the area /City Code.
	 * @param strLocalNumber Specifies an Local Number.
	 * @param strExtension Specifies an Extension.
	 * @param strAnyText Contains comments with respect to the telephone number.
	 * @param strExtensionPrefix Specifies the characters established within a company's 
	 * 							   internal telephone system network used as a prefix to the Extension component for internal dialing. 
	 * @param strSpeedDialCode Specifies The characters established within a 
	 * 							 company's internal telephone system used in place of the (external) telephone number.
	 * @param strUnformattedTelephoneNumber Specifies an expression of the telephone number as an unparsible string.
	 * @param strEffectiveStartDate Specifies start date.
	 * @param strExpirationDate Specifies expiration date.
	 * @param objExpirationReason Specifies reason why this contact is marked as ended.
	 * @param objProtectionCode Specifies reason why this information is sensitive or protected.
	 * @param objSharedTelecommunicationIdentifier Specifies a unique phone number phone telephone number or email-id.
	 * @param strPreferenceOrder Specifies the preference order for an entity..
	 */  
	public void addContactTelecommunication (String strTeleCommunicationUseCode,String strTeleCommunicationEquipmentType
			,String strCommuinicationAddress,String strCountryCode,String strAreaCityCode,String strLocalNumber,String strExtension,String strAnyText,
			String strExtensionPrefix,String strSpeedDialCode,String strUnformattedTelephoneNumber, String strEffectiveStartDate, String strExpirationDate,
			CWE objExpirationReason, CWE objProtectionCode, EI objSharedTelecommunicationIdentifier, String strPreferenceOrder)
	{
		XTN xtn  = (XTN)getDataElement(1269);
//		xtn.setTelephoneNumber(strTelephoneNumber);
		xtn.setTelecommunicationUseCode(strTeleCommunicationUseCode);
		xtn.setTelecommunicationEquipmentType(strTeleCommunicationEquipmentType);
		xtn.setCommuinicationAddress(strCommuinicationAddress);
		xtn.setCountryCode(strCountryCode);
		xtn.setAreaCityCode(strAreaCityCode);
		xtn.setLocalNumber(strLocalNumber);
		xtn.setExtension(strExtension);
		xtn.setAnyText(strAnyText);
		xtn.setExtensionPrefix(strExtensionPrefix);
		xtn.setSpeedDialCode(strSpeedDialCode);
		xtn.setUnformattedTelephonenumber(strUnformattedTelephoneNumber); 
		xtn.setEffectiveStartDate(strEffectiveStartDate);
		xtn.setExpirationDate(strExpirationDate);
		xtn.setExpirationReason(objExpirationReason);
		xtn.setProtectionCode(objProtectionCode);
		xtn.setSharedTelecommunicationIdentifier(objSharedTelecommunicationIdentifier);
		xtn.setPreferenceOrder(strPreferenceOrder);
		addContactTelecommunication(xtn);

	} 

	/** 
	 * Add the Contact Telecommunication.
	 * This field contains the primary contact person's telecommunication information.
	 * @param objcontactTelecommunication Object of Contact Telecommunication. 
	 */ 
	public void addContactTelecommunication(XTN objcontactTelecommunication)
	{
		addDataType(1269,objcontactTelecommunication);

	} 

	/** 
	 * Set the Contact Telecommunication.
	 * This field contains the primary contact person's telecommunication information.
	 * @param objcontactTelecommunicationList List Of Contact Telecommunication.
	 */ 
	@SuppressWarnings("unchecked")
	public void setContactTelecommunication(ISingleCollection<XTN> objcontactTelecommunicationList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objcontactTelecommunicationList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1269,objCollection);
	}

	/**
	 * Add the Contact Title.
	 * This field contains the primary contact person's title.
	 * @param strContactTitle This field contains the String Value of Contact Title 
	 */ 
	public void addContactTitle (String strContactTitle)
	{
		ST contactTitle  = (ST)getDataElement(1267);
		contactTitle.setValue(strContactTitle); 
		addContactTitle(contactTitle);

	} 

	/** 
	 * Add the Contact Title.
	 * This field contains the primary contact person's title.
	 * @param objcontactTitle Object of Contact Title. 
	 */ 
	public void addContactTitle(ST objcontactTitle)
	{
		addDataType(1267,objcontactTitle);

	} 

	/** 
	 * Set the Contact Title.
	 * This field contains the primary contact person's title.
	 * @param objcontactTitleList List of Contact Title. 
	 */ 
	@SuppressWarnings("unchecked")
	public void setContactTitle(ISingleCollection<ST> objcontactTitleList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objcontactTitleList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1267,objCollection);
	}

	/**
	 * Add the Facility Address.
	 * This field contains the facility's 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 addFacilityAddress (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(1264);
		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);
		addFacilityAddress(xad);

	} 

	/** 
	 * Add the Facility Address.
	 * This field contains the facility's address.
	 * @param objfacilityAddress Object of Facility Address.
	 */ 
	public void addFacilityAddress(XAD objfacilityAddress)
	{
		addDataType(1264,objfacilityAddress);

	} 

	/** 
	 * Set the Facility Address.
	 * This field contains the facility's address.
	 * @param objfacilityAddressList List of Facility Address.
	 */ 
	@SuppressWarnings("unchecked")
	public void setFacilityAddress(ISingleCollection<XAD> objfacilityAddressList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objfacilityAddressList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1264,objCollection);
	} 	 

	/**
	 * Set the Facility ID FAC.
	 * This field contains the facility identifier.
	 * @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 setFacilityID_FAC (String strEntityIdentifier,String strNamespaceId,
			String strUniversalId,String strUniversalIdType)
	{
		EI facilityID_FAC  = (EI)getDataElement(1262);
		facilityID_FAC.setEntityIdentifier(strEntityIdentifier);
		facilityID_FAC.setNamespaceId(strNamespaceId);
		facilityID_FAC.setUniversalId(strUniversalId);
		facilityID_FAC.setUniversalIdType(strUniversalIdType); 
		setFacilityID_FAC(facilityID_FAC);

	} 

	/** 
	 * Set the Facility ID FAC.
	 * This field contains the facility identifier.
	 * @param objfacilityID_FAC Object of Facility ID FAC. 
	 */ 
	public void setFacilityID_FAC(EI objfacilityID_FAC)
	{
		setDataType(1262,objfacilityID_FAC);

	}
	/**
	 * Set the Facility Telecommunication.
	 * This field contains the facility's telecommunication information.
	 * @param strTeleCommunicationUseCode Specifies a code that represents a specific use of a telecommunication number.
	 										Suggested values are PRN,ORN,WPN,VHN,ASN,EMR,NET,BPN  [Refer table 0201.]
	 * @param strTeleCommunicationEquipmentType Specifies a code that represents the type of telecommunication equipment.
	 * 											  Suggested values are PH,FX,MD,CP,BP,Internet,X.400,TDD,TTY  [Refer table 0202.]
	 * @param strCommuinicationAddress Specifies Email address.
	 * @param strCountryCode Specifies the Country code.
	 * @param strAreaCityCode Specifies the area /City Code.
	 * @param strLocalNumber Specifies an Local Number.
	 * @param strExtension Specifies an Extension.
	 * @param strAnyText Contains comments with respect to the telephone number.
	 * @param strExtensionPrefix Specifies the characters established within a company's 
	 * 							   internal telephone system network used as a prefix to the Extension component for internal dialing. 
	 * @param strSpeedDialCode Specifies The characters established within a 
	 * 							 company's internal telephone system used in place of the (external) telephone number.
	 * @param strUnformattedTelephoneNumber Specifies an expression of the telephone number as an unparsible string.
	 * @param strEffectiveStartDate Specifies start date.
	 * @param strExpirationDate Specifies expiration date.
	 * @param objExpirationReason Specifies reason why this contact is marked as ended.
	 * @param objProtectionCode Specifies reason why this information is sensitive or protected.
	 * @param objSharedTelecommunicationIdentifier Specifies a unique phone number phone telephone number or email-id.
	 * @param strPreferenceOrder Specifies the preference order for an entity..
	 */  
	public void setFacilityTelecommunication (String strTeleCommunicationUseCode,String strTeleCommunicationEquipmentType
			,String strCommuinicationAddress,String strCountryCode,String strAreaCityCode,String strLocalNumber,String strExtension,String strAnyText,
			String strExtensionPrefix,String strSpeedDialCode,String strUnformattedTelephoneNumber, String strEffectiveStartDate, String strExpirationDate,
			CWE objExpirationReason, CWE objProtectionCode, EI objSharedTelecommunicationIdentifier, String strPreferenceOrder)
	{
		XTN xtn  = (XTN)getDataElement(1265);
//		xtn.setTelephoneNumber(strTelephoneNumber);
		xtn.setTelecommunicationUseCode(strTeleCommunicationUseCode);
		xtn.setTelecommunicationEquipmentType(strTeleCommunicationEquipmentType);
		xtn.setCommuinicationAddress(strCommuinicationAddress);
		xtn.setCountryCode(strCountryCode);
		xtn.setAreaCityCode(strAreaCityCode);
		xtn.setLocalNumber(strLocalNumber);
		xtn.setExtension(strExtension);
		xtn.setAnyText(strAnyText);
		xtn.setExtensionPrefix(strExtensionPrefix);
		xtn.setSpeedDialCode(strSpeedDialCode);
		xtn.setUnformattedTelephonenumber(strUnformattedTelephoneNumber); 
		xtn.setEffectiveStartDate(strEffectiveStartDate);
		xtn.setExpirationDate(strExpirationDate);
		xtn.setExpirationReason(objExpirationReason);
		xtn.setProtectionCode(objProtectionCode);
		xtn.setSharedTelecommunicationIdentifier(objSharedTelecommunicationIdentifier);
		xtn.setPreferenceOrder(strPreferenceOrder);
 
		setFacilityTelecommunication(xtn);

	} 

	/** 
	 * Set the Facility Telecommunication.
	 * This field contains the facility's telecommunication information.
	 * @param objfacilityTelecommunication Object of Facility Telecommunication.
	 */ 
	public void setFacilityTelecommunication(XTN objfacilityTelecommunication)
	{
		setDataType(1265,objfacilityTelecommunication);

	}
	/**
	 * Set the Facility Type.
	 * This field contains the type of facility.  
	 * @param strFacilityType String which to set as Facility Type
	 */ 
	public void setFacilityType (String strFacilityType)
	{
		ID facilityType  = (ID)getDataElement(1263);
		facilityType.setValue(strFacilityType); 
		setFacilityType(facilityType);

	} 

	/** 
	 * Set the Facility Type.
	 * This field contains the type of facility.  
	 * @param objfacilityType Object of Facility Type.
	 */ 
	public void setFacilityType(ID objfacilityType)
	{
		setDataType(1263,objfacilityType);

	}
	/**
	 * Add the Signature Authority.
	 * This field contains the name of the individual with signature authority 
	 * or who is responsible for the report.
	 * @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 addSignatureAuthority (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(1270);
		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);
		addSignatureAuthority(xcn);

	} 

	/** 
	 * Add the Signature Authority.
	 * This field contains the name of the individual with signature authority 
	 * or who is responsible for the report.
	 * @param objsignatureAuthority Object of Signature Authority.
	 */ 
	public void addSignatureAuthority(XCN objsignatureAuthority)
	{
		addDataType(1270,objsignatureAuthority);

	} 

	/** 
	 * Set the Signature Authority.
	 * This field contains the name of the individual with signature authority 
	 * or who is responsible for the report.
	 * @param objsignatureAuthorityList List of Signature Authority.
	 */ 
	@SuppressWarnings("unchecked")
	public void setSignatureAuthority(ISingleCollection<XCN> objsignatureAuthorityList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objsignatureAuthorityList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1270,objCollection);
	}	 


	/**
	 * Add the Signature Authority Address.
	 * This field contains the address of the individual with signature authority or who is
	 *  responsible for this report.
     * @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 addSignatureAuthorityAddress (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(1272);
		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);
		addSignatureAuthorityAddress(xad);

	} 

	/** 
	 * Add the Signature Authority Address.
	 * This field contains the address of the individual with signature authority or who is
	 *  responsible for this report.
	 * @param objsignatureAuthorityAddress Object of Signature Authority Address.
	 */ 
	public void addSignatureAuthorityAddress(XAD objsignatureAuthorityAddress)
	{
		addDataType(1272,objsignatureAuthorityAddress);

	} 

	/** 
	 * Set the Signature Authority Address.
	 * This field contains the address of the individual with signature authority or who is
	 *  responsible for this report.
	 * @param objsignatureAuthorityAddressList List of Signature Authority Address.
	 */ 
	@SuppressWarnings("unchecked")
	public void setSignatureAuthorityAddress(ISingleCollection<XAD> objsignatureAuthorityAddressList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objsignatureAuthorityAddressList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1272,objCollection);
	}

	/**
	 * Set the Signature Authority Telecommunication.
	 * This field contains the telecommunication information of the 
	 * individual with signature authority of who is responsible for this report.
	 * @param strTeleCommunicationUseCode Specifies a code that represents a specific use of a telecommunication number.
	 										Suggested values are PRN,ORN,WPN,VHN,ASN,EMR,NET,BPN  [Refer table 0201.]
	 * @param strTeleCommunicationEquipmentType Specifies a code that represents the type of telecommunication equipment.
	 * 											  Suggested values are PH,FX,MD,CP,BP,Internet,X.400,TDD,TTY  [Refer table 0202.]
	 * @param strCommuinicationAddress Specifies Email address.
	 * @param strCountryCode Specifies the Country code.
	 * @param strAreaCityCode Specifies the area /City Code.
	 * @param strLocalNumber Specifies an Local Number.
	 * @param strExtension Specifies an Extension.
	 * @param strAnyText Contains comments with respect to the telephone number.
	 * @param strExtensionPrefix Specifies the characters established within a company's 
	 * 							   internal telephone system network used as a prefix to the Extension component for internal dialing. 
	 * @param strSpeedDialCode Specifies The characters established within a 
	 * 							 company's internal telephone system used in place of the (external) telephone number.
	 * @param strUnformattedTelephoneNumber Specifies an expression of the telephone number as an unparsible string.
	 * @param strEffectiveStartDate Specifies start date.
	 * @param strExpirationDate Specifies expiration date.
	 * @param objExpirationReason Specifies reason why this contact is marked as ended.
	 * @param objProtectionCode Specifies reason why this information is sensitive or protected.
	 * @param objSharedTelecommunicationIdentifier Specifies a unique phone number phone telephone number or email-id.
	 * @param strPreferenceOrder Specifies the preference order for an entity..
	 */
	public void setSignatureAuthorityTelecommunication (String strTeleCommunicationUseCode,String strTeleCommunicationEquipmentType
			,String strCommuinicationAddress,String strCountryCode,String strAreaCityCode,String strLocalNumber,String strExtension,String strAnyText,
			String strExtensionPrefix,String strSpeedDialCode,String strUnformattedTelephoneNumber, String strEffectiveStartDate, String strExpirationDate,
			CWE objExpirationReason, CWE objProtectionCode, EI objSharedTelecommunicationIdentifier, String strPreferenceOrder)
	{
		XTN xtn  = (XTN)getDataElement(1273);
//		xtn.setTelephoneNumber(strTelephoneNumber);
		xtn.setTelecommunicationUseCode(strTeleCommunicationUseCode);
		xtn.setTelecommunicationEquipmentType(strTeleCommunicationEquipmentType);
		xtn.setCommuinicationAddress(strCommuinicationAddress);
		xtn.setCountryCode(strCountryCode);
		xtn.setAreaCityCode(strAreaCityCode);
		xtn.setLocalNumber(strLocalNumber);
		xtn.setExtension(strExtension);
		xtn.setAnyText(strAnyText);
		xtn.setExtensionPrefix(strExtensionPrefix);
		xtn.setSpeedDialCode(strSpeedDialCode);
		xtn.setUnformattedTelephonenumber(strUnformattedTelephoneNumber); 
		xtn.setEffectiveStartDate(strEffectiveStartDate);
		xtn.setExpirationDate(strExpirationDate);
		xtn.setExpirationReason(objExpirationReason);
		xtn.setProtectionCode(objProtectionCode);
		xtn.setSharedTelecommunicationIdentifier(objSharedTelecommunicationIdentifier);
		xtn.setPreferenceOrder(strPreferenceOrder);
		setSignatureAuthorityTelecommunication(xtn);
	} 

	/** 
	 * Set the Signature Authority Telecommunication.
	 * This field contains the telecommunication information of the 
	 * individual with signature authority of who is responsible for this report.
	 * @param objsignatureAuthorityTelecommunication Object of Signature Authority Telecommunication.
	 */ 
	public void setSignatureAuthorityTelecommunication(XTN objsignatureAuthorityTelecommunication)
	{
		setDataType(1273,objsignatureAuthorityTelecommunication);

	}
	/**
	 * Set the Signature Authority Title.
	 * This field contains the address of the individual with signature authority or who is responsible for this report.
	 * @param strSignatureAuthorityTitle This field contains the String Value of Signature Authority Title 
	 */ 
	public void setSignatureAuthorityTitle (String strSignatureAuthorityTitle)
	{
		ST signatureAuthorityTitle  = (ST)getDataElement(1271);
		signatureAuthorityTitle.setValue(strSignatureAuthorityTitle); 
		setSignatureAuthorityTitle(signatureAuthorityTitle);

	} 

	/** 
	 * Set the Signature Authority Title.
	 * This field contains the address of the individual with signature authority or who is responsible for this report.
	 * @param objsignatureAuthorityTitle Object of Signature Authority Title. 
	 */ 
	public void setSignatureAuthorityTitle(ST objsignatureAuthorityTitle)
	{
		setDataType(1271,objsignatureAuthorityTitle);

	}

	/**
	 * 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 Thrown when Segment Validation Fails.  
	 */
	public boolean validate()throws InvalidSegmentException
	{
		/*
		 * Facility ID-FAC,Facility Address,Facility Telecommunication,Signature Authority are required fields.
		 */
		try
		{
			super.validate();

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