/*******************************************************************************
 *  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.HD;
import cdac.medinfo.sdk.hl7282.baselibs.ID;
import cdac.medinfo.sdk.hl7282.baselibs.NM;
import cdac.medinfo.sdk.hl7282.baselibs.PL;
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.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;

/**
 * BPO - Blood Product Order Segment.<p>
 * Blood product order messages require additional information that is not available in other
 * standard HL7 order messages.Blood product order messages need to contain accompanying details
 * regarding the blood product component, such as special processing requirements
 * (e.g. irradiation and leukoreduction) and the amount of the blood product to be administered.
 * <p>Represents an HL7 BPO message segment. 
 * This segment has the following fields:</p><p>
 * BPO-1: Set ID _ BPO (SI)<b>Required</b><br> 
 * BPO-2: BP Universal Service Identifier (CWE)<b>Required</b><br> 
 * BPO-3: BP  Processing Requirements (CWE)<b>Optional</b><br> 
 * BPO-4: BP Quantity (NM)<b>Required</b><br> 
 * BPO-5: BP Amount (NM)<b>Optional</b><br> 
 * BPO-6: BP Units (CWE)<b>Optional</b><br> 
 * BPO-7: BP Intended Use Date/Time (DTM)<b>Optional</b><br> 
 * BPO-8: BP Intended Dispense From Location (PL)<b>Optional</b><br> 
 * BPO-9: BP Intended Dispense From Address (XAD)<b>Optional</b><br> 
 * BPO-10: BP Requested Dispense Date/Time (DTM)<b>Optional</b><br> 
 * BPO-11: BP Requested Dispense To Location (PL)<b>Optional</b><br> 
 * BPO-12: BP Requested Dispense To Address (XAD)<b>Optional</b><br> 
 * BPO-13: BP Indication for Use (CWE)<b>Optional</b><br> 
 * BPO-14: BP Informed Consent Indicator (ID)<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 BPO extends Segment   
{
	

	/**
	 * Constructs the BPO segment.
	 */
	public BPO()
	{super(EnumSegments.HL7_SEG_BPO);
	}

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

	/**
	 * Retrieves the BP Amount.
	 * This field specify the order amount(volume) associated with each quantity of blood product.
	 * @return NM - bPAmount
	 */
	public NM getBPAmount() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1704);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (NM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the BP Indication for Use.
	 * This field specify the reason that the blood product is order.
	 * @return ISingleCollection<CWE> - bPIndicationforUse
	 */
	public ISingleCollection<CWE> getBPIndicationforUse() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1712);
		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 BP Informed Consent Indicator.
	 * This field indicates whether consent for the transfusion have been obtained.  
	 * @return ID - bPInformedConsentIndicator
	 */
	public ID getBPInformedConsentIndicator() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1713);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (ID)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the BP Intended Dispense From Address.
	 * This field contains the actual address of the location from which the blood component is to be dispensed.
	 * @return XAD - bPIntendedDispenseFromAddress
	 */
	public XAD getBPIntendedDispenseFromAddress() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1708);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (XAD)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the BP Intended Dispense From Location.
	 * This field specify the location from which the blood component is to be dispensed.
	 * @return PL - bPIntendedDispenseFromLocation
	 */
	public PL getBPIntendedDispenseFromLocation() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1707);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (PL)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the BP Intended Use Date Time.
	 * This field specify the date/time of the placer intends to use the blood product that is being ordered. 
	 * @return DTM - bPIntendedUseDateTime
	 */
	public DTM getBPIntendedUseDateTime() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1706);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the BP Processing Requirements.
	 * This field specify the additional information about the blood component class associated with the Universal Service ID. 
	 * @return ISingleCollection<CWE> - bPProcessingRequirements
	 */
	public ISingleCollection<CWE> getBPProcessingRequirements() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1702);
		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 BP Quantity.
	 * This field specify the number of blood products ordered.
	 * @return NM - bPQuantity
	 */
	public NM getBPQuantity() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1703);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (NM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the BP Requested Dispense Date Time.
	 * This field specify the date/time that the requested blood products must be ready to dispense.  
	 * @return DTM - bPRequestedDispenseDateTime
	 */
	public DTM getBPRequestedDispenseDateTime() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1709);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the BP Requested Dispense To Address.
	 * This field specify the actual address of the location to which the blood component is to be dispensed.
	 * @return XAD - bPRequestedDispenseToAddress
	 */
	public XAD getBPRequestedDispenseToAddress() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1711);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (XAD)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the BP Requested Dispense To Location.
	 * This field specify the inpatient or outpatient location to which the blood component is to be dispensed. 
	 * @return PL - bPRequestedDispenseToLocation
	 */
	public PL getBPRequestedDispenseToLocation() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1710);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (PL)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the BP Units.
	 * This field specify the units of measure for the blood product amount.  
	 * @return CWE - bPUnits
	 */
	public CWE getBPUnits() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1705);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the BP Universal Service Identifier.
	 * This field specify the identifier code for the requested blood product.
	 * @return CWE - bPUniversalServiceIdentifier
	 */
	public CWE getBPUniversalServiceIdentifier() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1701);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Set ID BPO.
	 * This field specify the sequence number for the BPO segment within the message.
	 * @return SI - setID_BPO
	 */
	public SI getSetID_BPO() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1700);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (SI)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Set the BP Amount.
	 * This field specify the order amount(volume) associated with each quantity of blood product.
	 * @param strAmount This field contains the String Value of Amount.
	 */ 
	public void setBPAmount (String strAmount) 
	{
		NM bPAmount  = (NM)getDataElement(1704);
		bPAmount.setValue(strAmount); 
		setBPAmount(bPAmount);

	} 

	/** 
	 * Set the BP Amount.
	 * This field specify the order amount(volume) associated with each quantity of blood product.
	 * @param objbPAmount Object of BP Amount.
	 */ 
	public void setBPAmount(NM objbPAmount)
	{
		setDataType(1704,objbPAmount);

	}
	/**
	 * Add the BP Indication for Use.
	 * This field specify the reason that the blood product is order.
	 * @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 addBPIndicationforUse (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(1712);
		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);
		addBPIndicationforUse(cwe);

	} 

	/** 
	 * Add the BP Indication for Use.
	 * This field specify the reason that the blood product is order.
	 * @param objbPIndicationforUse Object of BP Indication for Use.
	 */ 
	public void addBPIndicationforUse(CWE objbPIndicationforUse)
	{
		addDataType(1712,objbPIndicationforUse);

	} 

	/** 
	 * Set the BP Indication for Use.
	 * This field specify the reason that the blood product is order.
	 * @param objbPIndicationforUseList List of BP Indication for Use.
	 */ 
	@SuppressWarnings("unchecked")
	public void setBPIndicationforUse(ISingleCollection<CWE> objbPIndicationforUseList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objbPIndicationforUseList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1712,objCollection);
	}

	/**
	 * Set the BP Informed Consent Indicator.
	 * This field indicates whether consent for the transfusion have been obtained.  
	 * @param strBPInformedConsentIndicator String which to set as BP Informed Consent Indicator 
	 */ 
	public void setBPInformedConsentIndicator (String strBPInformedConsentIndicator)  
	{
		ID bPInformedConsentIndicator  = (ID)getDataElement(1713);
		bPInformedConsentIndicator.setValue(strBPInformedConsentIndicator); 
		setBPInformedConsentIndicator(bPInformedConsentIndicator);

	} 

	/** 
	 * Set the BP Informed Consent Indicator.
	 * This field indicates whether consent for the transfusion have been obtained.  
	 * @param objbPInformedConsentIndicator Object of BP Informed Consent Indicator.
	 */ 
	public void setBPInformedConsentIndicator(ID objbPInformedConsentIndicator)
	{
		setDataType(1713,objbPInformedConsentIndicator);

	}

	/**
	 * Set the BP Intended Dispense From Address.
	 * This field contains the actual address of the location from which the blood component is to be dispensed.
	 * @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 setBPIntendedDispenseFromAddress (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(1708);
		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); 
		setBPIntendedDispenseFromAddress(xad);

	} 

	/** 
	 * Set the BP Intended Dispense From Address.
	 * This field contains the actual address of the location from which the blood component is to be dispensed.
	 * @param objbPIntendedDispenseFromAddress Object of BP Intended Dispense From Address.
	 */ 
	public void setBPIntendedDispenseFromAddress(XAD objbPIntendedDispenseFromAddress)
	{
		setDataType(1708,objbPIntendedDispenseFromAddress);

	}

	/**
	 * Set the BP Intended Dispense From Location.
	 * This field specify the location from which the blood component is to be dispensed.
	 * @param strPointOfCare Specifies the code for the point where patient care is administered.
	 * @param strRoom Specifies the code for the patient's room. 
	 * @param strBed Specifies the code for the patient's bed. 
	 * @param objFacility Specifies to site interpretation but generally describes 
	 * 							the highest level physical designation of an institution, 
	 * 							medical center or enterprise. 
	 * @param strLocationStatus Specifies the code for the status or availability of the location. 
	 * @param strPersonLocationType Specifies the categorization of the person's location defined by 
	 * 									facility, building, floor, point of care, room or bed. 
	 * @param strBuilding Specifies code for the building where the person is located. 
	 * @param strFloor Specifies the code for the floor where the person is located.
	 * @param strLocationDescription Specifies describes the location in free text.
	 * @param objComprehensiveLocationIdentifier Specifies represents the physical location as 
	 *													a whole without regard for the individual components. 
	 * @param objAssigningAuthorityForLocation Specifies the entity that creates the data for the individual physical location components. 
	 */ 
	public void setBPIntendedDispenseFromLocation (HD objPointOfCare,HD objRoom,HD objBed,HD objFacility,
			String strLocationStatus,String strPersonLocationType,String strBuilding,String strFloor,
			String strLocationDescription,EI objComprehensiveLocationIdentifier,HD objAssigningAuthorityForLocation)
	{
		PL bPIntendedDispenseFromLocation  = (PL)getDataElement(1707);
		bPIntendedDispenseFromLocation.setPointOfCare(objPointOfCare);
		bPIntendedDispenseFromLocation.setRoom(objRoom);
		bPIntendedDispenseFromLocation.setBed(objBed);
		bPIntendedDispenseFromLocation.setFacility(objFacility);
		bPIntendedDispenseFromLocation.setLocationStatus(strLocationStatus);
		bPIntendedDispenseFromLocation.setPersonLocationType(strPersonLocationType);
		bPIntendedDispenseFromLocation.setBuilding(strBuilding);
		bPIntendedDispenseFromLocation.setFloor(strFloor);
		bPIntendedDispenseFromLocation.setLocationDescription(strLocationDescription);
		bPIntendedDispenseFromLocation.setComprehensiveLocationIdentifier(objComprehensiveLocationIdentifier);
		bPIntendedDispenseFromLocation.setAssigningAuthorityForLocation(objAssigningAuthorityForLocation); 
		setBPIntendedDispenseFromLocation(bPIntendedDispenseFromLocation);

	} 

	/** 
	 * Set the BP Intended Dispense From Location.
	 * This field specify the location from which the blood component is to be dispensed.
	 * @param objbPIntendedDispenseFromLocation object of BP Intended Dispense From Location.
	 */ 
	public void setBPIntendedDispenseFromLocation(PL objbPIntendedDispenseFromLocation)
	{
		setDataType(1707,objbPIntendedDispenseFromLocation);

	}

	/**
	 * Set the BP Intended Use Date Time.
	 * This field specify the date/time of the placer intends to use the blood product that is being ordered. 
	 * @param strTime Specifies a point in time using a 24-hour clock notation. 
	 */ 
	public void setBPIntendedUseDateTime (String strTime) 
	{
		DTM bPIntendedUseDateTime  = (DTM)getDataElement(1706);
		bPIntendedUseDateTime.setValue(strTime);
		setBPIntendedUseDateTime(bPIntendedUseDateTime);

	} 

	/** 
	 * Set the BP Intended Use Date Time.
	 * This field specify the date/time of the placer intends to use the blood product that is being ordered. 
	 * @param objbPIntendedUseDateTime Object of BP Intended Use Date Time.
	 */ 
	public void setBPIntendedUseDateTime(DTM objbPIntendedUseDateTime)
	{
		setDataType(1706,objbPIntendedUseDateTime);

	}

	/**
	 * Add the BP Processing Requirements.
	 * This field specify the additional information about the blood component class associated with the Universal Service ID. 
	 * @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 addBPProcessingRequirements (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(1702);
		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);
		addBPProcessingRequirements(cwe);

	} 

	/** 
	 * Add the BP Processing Requirements.
	 * This field specify the additional information about the blood component class associated with the Universal Service ID. 
	 * @param objbPProcessingRequirements Object of BP Processing Requirements.
	 */ 
	public void addBPProcessingRequirements(CWE objbPProcessingRequirements)
	{
		addDataType(1702,objbPProcessingRequirements);

	}                    

	/** 
	 * Set the BP Processing Requirements.
	 * This field specify the additional information about the blood component class associated with the Universal Service ID. 
	 * @param objbPProcessingRequirementsList List of BP Processing Requirements.
	 */ 
	@SuppressWarnings("unchecked")
	public void setBPProcessingRequirements(ISingleCollection<CWE> objbPProcessingRequirementsList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objbPProcessingRequirementsList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1702,objCollection);
	}

	/**
	 * Set the BP Quantity.
	 * This field specify the number of blood products ordered.
	 * @param strQuantity This field contains the String Value of Quantity
	 */ 
	public void setBPQuantity (String strQuantity) 
	{
		NM bPQuantity  = (NM)getDataElement(1703);
		bPQuantity.setValue(strQuantity); 
		setBPQuantity(bPQuantity);

	} 

	/** 
	 * Set the BP Quantity.
	 * This field specify the number of blood products ordered.
	 * @param objbPQuantity Object of BP Quantity.
	 */ 
	public void setBPQuantity(NM objbPQuantity)
	{
		setDataType(1703,objbPQuantity);

	}

	/**
	 * Set the BP Requested Dispense Date Time.
	 * This field specify the date/time that the requested blood products must be ready to dispense.  
	 * @param strTime Specifies a point in time using a 24-hour clock notation. 
	 */ 
	public void setBPRequestedDispenseDateTime (String strTime) 
	{
		DTM bPRequestedDispenseDateTime  = (DTM)getDataElement(1709);
		bPRequestedDispenseDateTime.setValue(strTime);
		setBPRequestedDispenseDateTime(bPRequestedDispenseDateTime);

	} 

	/** 
	 * Set the BP Requested Dispense Date Time.
	 * This field specify the date/time that the requested blood products must be ready to dispense.
	 * @param objbPRequestedDispenseDateTime Object of BP Requested Dispense Date Time.
	 */ 
	public void setBPRequestedDispenseDateTime(DTM objbPRequestedDispenseDateTime)
	{
		setDataType(1709,objbPRequestedDispenseDateTime);

	}

	/**
	 * Set the BP Requested Dispense To Address.
	 * This field specify the actual address of the location to which the blood component is to be dispensed.
	 * @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 setBPRequestedDispenseToAddress (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(1711);
		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); 
		setBPRequestedDispenseToAddress(xad);

	} 

	/** 
	 * Set the BP Requested Dispense To Address.
	 * This field specify the actual address of the location to which the blood component is to be dispensed.
	 * @param objbPRequestedDispenseToAddress object of BP Requested Dispense To Address.
	 */ 
	public void setBPRequestedDispenseToAddress(XAD objbPRequestedDispenseToAddress)
	{
		setDataType(1711,objbPRequestedDispenseToAddress);

	}

	/**
	 * Set the BP Requested Dispense To Location.
	 * This field specify the inpatient or outpatient location to which the blood component is to be dispensed. 
	 * @param strPointOfCare Specifies the code for the point where patient care is administered.
	 * @param strRoom Specifies the code for the patient's room. 
	 * @param strBed Specifies the code for the patient's bed. 
	 * @param objFacility Specifies to site interpretation but generally describes 
	 * 							the highest level physical designation of an institution, 
	 * 							medical center or enterprise. 
	 * @param strLocationStatus Specifies the code for the status or availability of the location. 
	 * @param strPersonLocationType Specifies the categorization of the person's location defined by 
	 * 									facility, building, floor, point of care, room or bed. 
	 * @param strBuilding Specifies code for the building where the person is located. 
	 * @param strFloor Specifies the code for the floor where the person is located.
	 * @param strLocationDescription Specifies describes the location in free text.
	 * @param objComprehensiveLocationIdentifier Specifies represents the physical location as 
	 *													a whole without regard for the individual components. 
	 * @param objAssigningAuthorityForLocation Specifies the entity that creates the data for the individual physical location components. 
	 */ 
	public void setBPRequestedDispenseToLocation (HD objPointOfCare,HD objRoom,HD objBed,HD objFacility,
			String strLocationStatus,String strPersonLocationType,String strBuilding,String strFloor,
			String strLocationDescription,EI objComprehensiveLocationIdentifier,HD objAssigningAuthorityForLocation)
	{
		PL bPRequestedDispenseToLocation  = (PL)getDataElement(1710);
		bPRequestedDispenseToLocation.setPointOfCare(objPointOfCare);
		bPRequestedDispenseToLocation.setRoom(objRoom);
		bPRequestedDispenseToLocation.setBed(objBed);
		bPRequestedDispenseToLocation.setFacility(objFacility);
		bPRequestedDispenseToLocation.setLocationStatus(strLocationStatus);
		bPRequestedDispenseToLocation.setPersonLocationType(strPersonLocationType);
		bPRequestedDispenseToLocation.setBuilding(strBuilding);
		bPRequestedDispenseToLocation.setFloor(strFloor);
		bPRequestedDispenseToLocation.setLocationDescription(strLocationDescription);
		bPRequestedDispenseToLocation.setComprehensiveLocationIdentifier(objComprehensiveLocationIdentifier);
		bPRequestedDispenseToLocation.setAssigningAuthorityForLocation(objAssigningAuthorityForLocation); 
		setBPRequestedDispenseToLocation(bPRequestedDispenseToLocation);

	} 

	/** 
	 * Set the BP Requested Dispense To Location.
	 * This field specify the inpatient or outpatient location to which the blood component is to be dispensed. 
	 * @param objbPRequestedDispenseToLocation Object of BP Requested Dispense To Location.
	 */ 
	public void setBPRequestedDispenseToLocation(PL objbPRequestedDispenseToLocation)
	{
		setDataType(1710,objbPRequestedDispenseToLocation);

	}

	/**
	 * Set the BP Units.
	 * This field specify the units of measure for the blood product amount.  
	 * @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 setBPUnits (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(1705);
		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);
		setBPUnits(cwe);

	} 

	/** 
	 * Set the BP Units.
	 * This field specify the units of measure for the blood product amount.  
	 * @param objbPUnits Object of BP Units.
	 */ 
	public void setBPUnits(CWE objbPUnits)
	{
		setDataType(1705,objbPUnits);

	}

	/**
	 * Set the BP Universal Service Identifier.
	 * This field specify the identifier code for the requested blood product.
	 * @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 setBPUniversalServiceIdentifier(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(1701);
		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);
		setBPUniversalServiceIdentifier(cwe);

	} 

	/** 
	 * Set the BP Universal Service ID.
	 * This field specify the identifier code for the requested blood product.
	 * @param objbPUniversalServiceID Object of BP Universal Service Identifier.
	 */ 
	public void setBPUniversalServiceIdentifier(CWE objbPUniversalServiceID)
	{
		setDataType(1701,objbPUniversalServiceID);

	}

	/**
	 * Set the Set ID BPO.
	 * This field specify the sequence number for the BPO segment within the message.
	 * @param strSetID_BPO This field contains the String Value of Set ID - BPO
	 */ 
	public void setSetID_BPO (String strSetID_BPO) 
	{
		SI setID_BPO  = (SI)getDataElement(1700);
		setID_BPO.setValue(strSetID_BPO); 
		setSetID_BPO(setID_BPO);

	} 

	/** 
	 * Set the Set ID BPO.
	 * This field specify the sequence number for the BPO segment within the message.
	 * @param objsetID_BPO Object of Set ID BPO.
	 */ 
	public void setSetID_BPO(SI objsetID_BPO)
	{
		setDataType(1700,objsetID_BPO);

	}

	/**
	 * 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
	{
		try
		{
			/*
			 * Set ID - BPO,BP Universal Service ID,BP Quantity are required fields.
			 */
			super.validate();

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