package cdac.medinfo.sdk.hl7282.hl7model;


import cdac.medinfo.sdk.hl7282.baselibs.CNE;
import cdac.medinfo.sdk.hl7282.baselibs.CP;
import cdac.medinfo.sdk.hl7282.baselibs.CQ;
import cdac.medinfo.sdk.hl7282.baselibs.CWE;
import cdac.medinfo.sdk.hl7282.baselibs.CX;
import cdac.medinfo.sdk.hl7282.baselibs.DLD;
import cdac.medinfo.sdk.hl7282.baselibs.DR;
import cdac.medinfo.sdk.hl7282.baselibs.DT;
import cdac.medinfo.sdk.hl7282.baselibs.DTM;
import cdac.medinfo.sdk.hl7282.baselibs.ED;
import cdac.medinfo.sdk.hl7282.baselibs.EI;
import cdac.medinfo.sdk.hl7282.baselibs.EIP;
import cdac.medinfo.sdk.hl7282.baselibs.FC;
import cdac.medinfo.sdk.hl7282.baselibs.FN;
import cdac.medinfo.sdk.hl7282.baselibs.FT;
import cdac.medinfo.sdk.hl7282.baselibs.HD;
import cdac.medinfo.sdk.hl7282.baselibs.ID;
import cdac.medinfo.sdk.hl7282.baselibs.JCC;
import cdac.medinfo.sdk.hl7282.baselibs.MO;
import cdac.medinfo.sdk.hl7282.baselibs.MOC;
import cdac.medinfo.sdk.hl7282.baselibs.MSG;
import cdac.medinfo.sdk.hl7282.baselibs.NDL;
import cdac.medinfo.sdk.hl7282.baselibs.NM;
import cdac.medinfo.sdk.hl7282.baselibs.OG;
import cdac.medinfo.sdk.hl7282.baselibs.PL;
import cdac.medinfo.sdk.hl7282.baselibs.PLN;
import cdac.medinfo.sdk.hl7282.baselibs.PPN;
import cdac.medinfo.sdk.hl7282.baselibs.PRL;
import cdac.medinfo.sdk.hl7282.baselibs.PT;
import cdac.medinfo.sdk.hl7282.baselibs.RPT;
import cdac.medinfo.sdk.hl7282.baselibs.SAD;
import cdac.medinfo.sdk.hl7282.baselibs.SI;
import cdac.medinfo.sdk.hl7282.baselibs.ST;
import cdac.medinfo.sdk.hl7282.baselibs.TM;
import cdac.medinfo.sdk.hl7282.baselibs.TX;
import cdac.medinfo.sdk.hl7282.baselibs.VID;
import cdac.medinfo.sdk.hl7282.baselibs.XAD;
import cdac.medinfo.sdk.hl7282.baselibs.XCN;
import cdac.medinfo.sdk.hl7282.baselibs.XON;
import cdac.medinfo.sdk.hl7282.baselibs.XPN;
import cdac.medinfo.sdk.hl7282.baselibs.XTN;
import cdac.medinfo.sdk.hl7282.baselibs.datatypefactory.DataTypeMapReader;
import cdac.medinfo.sdk.hl7282.baselibs.messagedictionary.MessageMapReader;
import cdac.medinfo.sdk.hl7282.baselibs.messages.Group;
import cdac.medinfo.sdk.hl7282.baselibs.segments.ARV;
import cdac.medinfo.sdk.hl7282.baselibs.segments.CTD;
import cdac.medinfo.sdk.hl7282.baselibs.segments.CTI;
import cdac.medinfo.sdk.hl7282.baselibs.segments.DSC;
import cdac.medinfo.sdk.hl7282.baselibs.segments.FT1;
import cdac.medinfo.sdk.hl7282.baselibs.segments.MSH;
import cdac.medinfo.sdk.hl7282.baselibs.segments.NK1;
import cdac.medinfo.sdk.hl7282.baselibs.segments.NTE;
import cdac.medinfo.sdk.hl7282.baselibs.segments.OBR;
import cdac.medinfo.sdk.hl7282.baselibs.segments.OBX;
import cdac.medinfo.sdk.hl7282.baselibs.segments.ORC;
import cdac.medinfo.sdk.hl7282.baselibs.segments.PD1;
import cdac.medinfo.sdk.hl7282.baselibs.segments.PID;
import cdac.medinfo.sdk.hl7282.baselibs.segments.PRT;
import cdac.medinfo.sdk.hl7282.baselibs.segments.PV1;
import cdac.medinfo.sdk.hl7282.baselibs.segments.PV2;
import cdac.medinfo.sdk.hl7282.baselibs.segments.SFT;
import cdac.medinfo.sdk.hl7282.baselibs.segments.SPM;
import cdac.medinfo.sdk.hl7282.baselibs.segments.TQ1;
import cdac.medinfo.sdk.hl7282.baselibs.segments.TQ2;
import cdac.medinfo.sdk.hl7282.baselibs.segments.TXA;
import cdac.medinfo.sdk.hl7282.baselibs.segments.UAC;
import cdac.medinfo.sdk.hl7282.commoninterface.IDataType;
import cdac.medinfo.sdk.hl7282.commoninterface.IGroup;
import cdac.medinfo.sdk.hl7282.commoninterface.ISegment;
import cdac.medinfo.sdk.hl7282.commoninterface.ISingleCollection;
import cdac.medinfo.sdk.hl7282.hl7model.messages.observationreporting.ORU_R01;
import cdac.medinfo.sdk.hl7282.hl7model.messages.observationreporting.ObsvRepRecepient;
import cdac.medinfo.sdk.hl7282.utils.EnumDataType;
import cdac.medinfo.sdk.hl7282.utils.EnumMessageCode;
import cdac.medinfo.sdk.hl7282.utils.EnumSegments;
import cdac.medinfo.sdk.hl7282.utils.EnumTriggerEvent;
import cdac.medinfo.sdk.hl7282.utils.HL7Config;
import cdac.medinfo.sdk.hl7282.utils.HL7Constants;
import cdac.medinfo.sdk.hl7282.utils.IDataTypeMap;
import cdac.medinfo.sdk.hl7282.utils.IDataTypeMapReader;
import cdac.medinfo.sdk.hl7282.utils.IMap;
import cdac.medinfo.sdk.hl7282.utils.IMultiValuedPairedCollection;

public class ORU_R01_Dispaly
{
	static IDataTypeMapReader dataTypeMapReader = DataTypeMapReader.createInstance();
	static IDataTypeMap dtmap = dataTypeMapReader.getDataTypeMap(EnumDataType.HL7_DT_HD.getValue());
	static HD objAssigningAuthority = new HD(HL7Constants.HL7_SUBCOMPONENT,dtmap);
	static HD objAssigningFacility = new HD(HL7Constants.HL7_SUBCOMPONENT,dtmap);
	
	static IDataTypeMap dtmap1 = dataTypeMapReader.getDataTypeMap(EnumDataType.HL7_DT_CWE.getValue());
	static CWE objAssigningJurisdiction = new CWE(HL7Constants.HL7_SUBCOMPONENT,dtmap1);
	static CWE objAssigningAgencyOrDepartment = new CWE(HL7Constants.HL7_SUBCOMPONENT,dtmap1);
	static CWE objNameContext = new CWE(HL7Constants.HL7_SUBCOMPONENT,dtmap1);
	
	static IDataTypeMap dtmap2 = dataTypeMapReader.getDataTypeMap(EnumDataType.HL7_DT_FN.getValue());
	static FN objFamilyName = new FN(HL7Constants.HL7_SUBCOMPONENT,dtmap2);
	
	//	static DR objNameValidityRange = new DR(53,HL7Constants.HL7_SUBCOMPONENT);
	static DTM objEffectiveDate = new DTM(4, 24, "8#");
	static DTM objExpirationDate = new DTM(4, 24, "8#");
	
	static IDataTypeMap dtmap3 = dataTypeMapReader.getDataTypeMap(EnumDataType.HL7_DT_SAD.getValue());
	static SAD objStreetAddress = new SAD(HL7Constants.HL7_SUBCOMPONENT,dtmap3);

	private ORU_R01_Dispaly()
	{
		objAssigningAuthority.setNamespaceId("REGAD1");
		objAssigningAuthority.setUniversalId("UI1");
		objAssigningAuthority.setUniversalIdType("GUID");

		objAssigningFacility.setNamespaceId("REGAD1");
		objAssigningFacility.setUniversalId("UI1");
		objAssigningFacility.setUniversalIdType("GUID");

		objAssigningJurisdiction.setIdentifier("AB");
		objAssigningJurisdiction.setText("TEXT");
		objAssigningJurisdiction.setNameOfCodingSystem("HL7");
		objAssigningJurisdiction.setAlternateIdentifier("AI1");
		objAssigningJurisdiction.setAlternateText("AT1");
		objAssigningJurisdiction.setNameOfAlternateCodingSystem("99");
		objAssigningJurisdiction.setCodingSystemVersionID("2.337");
		objAssigningJurisdiction.setAlternateCodingSystemVersionId("ACSVID1");
		objAssigningJurisdiction.setOriginalText("OT1"); 

		objAssigningAgencyOrDepartment.setIdentifier("AB");
		objAssigningAgencyOrDepartment.setText("TEXT");
		objAssigningAgencyOrDepartment.setNameOfCodingSystem("HL7");
		objAssigningAgencyOrDepartment.setAlternateIdentifier("AI2");
		objAssigningAgencyOrDepartment.setAlternateText("AT2");
		objAssigningAgencyOrDepartment.setNameOfAlternateCodingSystem("HL7");
		objAssigningAgencyOrDepartment.setCodingSystemVersionID("2.337");
		objAssigningAgencyOrDepartment.setAlternateCodingSystemVersionId("ACSVID2");
		objAssigningAgencyOrDepartment.setOriginalText("OT2"); 

		objFamilyName.setSurname("Kulkarni");
		objFamilyName.setOwnSurnamePrefix("OSP");
		objFamilyName.setOwnSurname("OS");
		objFamilyName.setSurnamePrefixFromPartnerSpouse("SPFPS");
		objFamilyName.setSurnameFromPartnerSpouse("SPD");

		objNameContext.setIdentifier("AB");
		objNameContext.setText("TEXT2");
		objNameContext.setNameOfCodingSystem("HL7");
		objNameContext.setAlternateIdentifier("AI3");
		objNameContext.setAlternateText("AT3");
		objNameContext.setNameOfAlternateCodingSystem("98");

		objEffectiveDate.setValue("20050302");
		objExpirationDate.setValue("20050302");

		objStreetAddress.setStreetOrMailingAddress("SAOMA");
		objStreetAddress.setStreetName("SN");
		objStreetAddress.setStreetOrMailingAddress("DN");
	}

	public static void main( String[] args ) 
	{ 
		

		//Specifying logging directory.
		//User can specify any directory where log files will be created.
		//If no path is specified then logs will be generated in user's temp directory.
		HL7Config.createInstance().enableLogging("E:\\HL7Model_Logs");

		ORU_R01_Dispaly objORU_R01 = new ORU_R01_Dispaly();
		objORU_R01.start();
	}

	private void start()
	{		
		try
		{
			ORU_R01 objORU_R01 = (ORU_R01)new ObsvRepRecepient().createMessage(EnumMessageCode.ORU, EnumTriggerEvent.R01);
			populateMessage(objORU_R01);

			display(objORU_R01);
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}

	private void display(ORU_R01 objMessage)
	{		
		MSH objMSH = objMessage.getHeader();
		ISingleCollection<SFT> objSFTCollection = objMessage.getSoftwareSegments();
		ISingleCollection<IGroup> objPatientResultCollection = objMessage.getPatientResultGroups();
		DSC objDSC = objMessage.getContinuationPointerSegment();

		//Retrieve contents of MSH Segment
		displayMSH(objMSH);

		//Retrieve contents of SFT Segment
		if(objSFTCollection != null)
			displaySFT(objSFTCollection);

		//Retrieve contents of PATIENT_RESULT Group
		if(objPatientResultCollection != null)
		{
			for(IGroup objPatientResultGroup : objPatientResultCollection)
			{
				ISingleCollection<IGroup> objPatientGroupCollection = objPatientResultGroup.getGroup(EnumSegments.HL7_GROUP_PATIENT);
				IGroup objPatientGroup = objPatientGroupCollection.elementAt(0);

				ISingleCollection<ISegment> objPIDCollection = objPatientGroup.getSegment(EnumSegments.HL7_SEG_PID);
				if(objPIDCollection != null)
				{
					PID objPID = (PID)objPIDCollection.elementAt(0);
					displayPID(objPID);
				}

				ISingleCollection<ISegment> objPD1Collection = objPatientGroup.getSegment(EnumSegments.HL7_SEG_PD1);
				if(objPD1Collection != null)
				{
					PD1 objPD1 = (PD1)objPD1Collection.elementAt(0);
					displayPD1(objPD1);
				}

				ISingleCollection<ISegment> objNTECollection = objPatientGroup.getSegment(EnumSegments.HL7_SEG_NTE);
				if(objNTECollection != null)
					displayNTE(objNTECollection);

				ISingleCollection<ISegment> objNK1Collection = objPatientGroup.getSegment(EnumSegments.HL7_SEG_NK1);
				if(objNK1Collection != null)
					displayNK1(objNK1Collection);

				ISingleCollection<IGroup> objVisitGroupCollection = objPatientGroup.getGroup(EnumSegments.HL7_GROUP_VISIT);
				IGroup objVisitGroup = objVisitGroupCollection.elementAt(0);

				ISingleCollection<ISegment> objPV1Collection = objVisitGroup.getSegment(EnumSegments.HL7_SEG_PV1);
				if(objPV1Collection != null)
				{
					PV1 objPV1 = (PV1)objPV1Collection.elementAt(0);
					displayPV1(objPV1);
				}

				ISingleCollection<ISegment> objPV2Collection = objVisitGroup.getSegment(EnumSegments.HL7_SEG_PV2);
				if(objPV2Collection != null)
				{
					PV2 objPV2 = (PV2)objPV2Collection.elementAt(0);
					displayPV2(objPV2);
				}

				ISingleCollection<IGroup> objOrderObservationGroupCollection = objPatientResultGroup.getGroup(EnumSegments.HL7_GROUP_ORDER_OBSERVATION);

				if(objOrderObservationGroupCollection != null)
				{
					for(IGroup objOrderObservationGroup : objOrderObservationGroupCollection)
					{
						ISingleCollection<ISegment> objORCCollection = objOrderObservationGroup.getSegment(EnumSegments.HL7_SEG_ORC);
						if(objORCCollection != null)
						{
							ORC objORC = (ORC)objORCCollection.elementAt(0);
							displayORC(objORC);
						}

						ISingleCollection<ISegment> objOBRCollection = objOrderObservationGroup.getSegment(EnumSegments.HL7_SEG_OBR);
						if(objOBRCollection != null)
						{
							OBR objOBR = (OBR)objOBRCollection.elementAt(0);
							displayOBR(objOBR);
						}

						objNTECollection = null;
						objNTECollection = objOrderObservationGroup.getSegment(EnumSegments.HL7_SEG_NTE);
						if(objNTECollection != null)
							displayNTE(objNTECollection);

						ISingleCollection<IGroup> objTimingQuantityGroupCollection = objOrderObservationGroup.getGroup(EnumSegments.HL7_GROUP_TIMING_QUANTITY);

						if(objTimingQuantityGroupCollection != null)
						{
							for(IGroup objTimingQuantityGroup : objTimingQuantityGroupCollection)
							{
								ISingleCollection<ISegment> objTQ1Collection = objTimingQuantityGroup.getSegment(EnumSegments.HL7_SEG_TQ1);
								if(objTQ1Collection != null)
								{
									TQ1 objTQ1 = (TQ1)objTQ1Collection.elementAt(0);
									displayTQ1(objTQ1);
								}

								ISingleCollection<ISegment> objTQ2Collection = objTimingQuantityGroup.getSegment(EnumSegments.HL7_SEG_TQ2);
								if(objTQ2Collection != null)
									displayTQ2(objTQ2Collection);							
							}
						}

						ISingleCollection<ISegment> objCTDCollection = objOrderObservationGroup.getSegment(EnumSegments.HL7_SEG_CTD);
						if(objCTDCollection != null)
						{
							CTD objCTD = (CTD)objCTDCollection.elementAt(0);
							displayCTD(objCTD);
						}

						ISingleCollection<IGroup> objObservationGroupCollection = objOrderObservationGroup.getGroup(EnumSegments.HL7_GROUP_OBSERVATION);

						if(objObservationGroupCollection != null)
						{
							for(IGroup objObservationGroup : objObservationGroupCollection)
							{
								ISingleCollection<ISegment> objOBXCollection = objObservationGroup.getSegment(EnumSegments.HL7_SEG_OBX);
								if(objOBXCollection != null)
								{
									OBX objOBX = (OBX)objOBXCollection.elementAt(0);
									displayOBX(objOBX);
								}

								objNTECollection = null;
								objNTECollection = objObservationGroup.getSegment(EnumSegments.HL7_SEG_NTE);
								if(objNTECollection != null)
									displayNTE(objNTECollection);
							}
						}

						ISingleCollection<ISegment> objFT1Collection = objOrderObservationGroup.getSegment(EnumSegments.HL7_SEG_FT1);
						if(objFT1Collection != null)
							displayFT1(objFT1Collection);

						ISingleCollection<ISegment> objCTICollection = objOrderObservationGroup.getSegment(EnumSegments.HL7_SEG_CTI);
						if(objCTICollection != null)
							displayCTI(objCTICollection);

						ISingleCollection<IGroup> objSpecimenGroupCollection = objOrderObservationGroup.getGroup(EnumSegments.HL7_GROUP_SPECIMEN);

						if(objSpecimenGroupCollection != null)
						{
							for(IGroup objSpecimenGroup : objSpecimenGroupCollection)
							{
								ISingleCollection<ISegment> objSPMCollection = objSpecimenGroup.getSegment(EnumSegments.HL7_SEG_SPM);
								if(objSPMCollection != null)
								{
									SPM objSPM = (SPM)objSPMCollection.elementAt(0);
									displaySPM(objSPM);
								}

								ISingleCollection<ISegment> objOBXCollection = objSpecimenGroup.getSegment(EnumSegments.HL7_SEG_OBX);
								if(objOBXCollection != null)
									displayOBX(objOBXCollection);							
							}
						}					
					}
				}			
			}
		}

		//Retrieve contents of DSC segment
		if(objDSC != null)
			displayDSC(objDSC);
	}


	private void displayMSH(MSH objMSH)
	{
		//Retrieve contents of MSH segment
		System.out.println("MSH::");
		ST objFieldSeparator = objMSH.getFieldSeparator();
		if(objFieldSeparator != null)
		{
			System.out.println("FieldSeparator::" + objFieldSeparator.getValue());
		}
		ST objEncodingChar = objMSH.getEncodingChar();
		if(objEncodingChar != null)
		{
			System.out.println("EncodingChar::" + objEncodingChar.getValue());
		}
		HD objSendingApplication = objMSH.getSendingApplication();
		if(objSendingApplication != null)
		{
			System.out.println("SendingApplication::" + getValue(objSendingApplication));
		}
		HD objSendingFacility = objMSH.getSendingFacility();
		if(objSendingFacility != null)
		{
			System.out.println("SendingFacility::" + getValue(objSendingFacility));
		}
		HD objReceivingApplication = objMSH.getReceivingApplication();
		if(objReceivingApplication != null)
		{
			System.out.println("ReceivingApplication::" + getValue(objReceivingApplication));
		}
		HD objReceivingFacility = objMSH.getReceivingFacility();
		if(objReceivingFacility != null)
		{
			System.out.println("ReceivingFacility::" + getValue(objReceivingFacility));
		}
		DTM objDateTimeOfMessage = objMSH.getDateTimeOfMessage();
		if(objDateTimeOfMessage != null)
		{
			System.out.println("DateTimeOfMessage::" + getValue(objDateTimeOfMessage));
		}
		ST objSecurity = objMSH.getSecurity();
		if(objSecurity != null)
		{
			System.out.println("Security::" + objSecurity.getValue());
		}
		MSG objMessageType = objMSH.getMessageType();
		if(objMessageType != null)
		{
			System.out.println("MessageType::" + getValue(objMessageType));
		}
		ST objMessageControlID = objMSH.getMessageControlID();
		if(objMessageControlID != null)
		{
			System.out.println("MessageControlID::" + objMessageControlID.getValue());
		}
		PT objProcessingID = objMSH.getProcessingID();
		if(objProcessingID != null)
		{
			System.out.println("ProcessingID::" + getValue(objProcessingID));
		}
		VID objVersionID = objMSH.getVersionID();
		if(objVersionID != null)
		{
			System.out.println("VersionID::" + getValue(objVersionID));
		}
		NM objSequenceNumber = objMSH.getSequenceNumber();
		if(objSequenceNumber != null)
		{
			System.out.println("SequenceNumber::" + objSequenceNumber.getValue());
		}
		ST objContinuationPointer = objMSH.getContinuationPointer();
		if(objContinuationPointer != null)
		{
			System.out.println("ContinuationPointer::" + objContinuationPointer.getValue());
		}
		ID objAcceptAcknowledgmentType = objMSH.getAcceptAcknowledgmentType();
		if(objAcceptAcknowledgmentType != null)
		{
			System.out.println("AcceptAcknowledgmentType::" + objAcceptAcknowledgmentType.getValue());
		}
		ID objApplicationAcknowledgmentType = objMSH.getApplicationAcknowledgmentType();
		if(objApplicationAcknowledgmentType != null)
		{
			System.out.println("ApplicationAcknowledgmentType::" + objApplicationAcknowledgmentType.getValue());
		}
		ID objCountryCode = objMSH.getCountryCode();
		if(objCountryCode != null)
		{
			System.out.println("CountryCode::" + objCountryCode.getValue());
		}
		ISingleCollection<ID> objCharacterSetCollection = objMSH.getCharacterSet();
		for(ID idCharSet : objCharacterSetCollection)
		{
			if(idCharSet != null)
			{
				System.out.println("CharSet::" + idCharSet.getValue());
			}
		}		
		CWE objPrincipalLanguageOfMessage = objMSH.getPrincipalLanguageOfMessage();
		if(objPrincipalLanguageOfMessage != null)
		{
			System.out.println("PrincipalLanguageOfMessage::" + getValue(objPrincipalLanguageOfMessage));
		}
		ID objAlternateCharacterSetHandlingScheme = objMSH.getAlternateCharacterSetHandlingScheme();
		if(objAlternateCharacterSetHandlingScheme != null)
		{
			System.out.println("AlternateCharacterSetHandlingScheme::" + objAlternateCharacterSetHandlingScheme.getValue());
		}
		ISingleCollection<EI> objMessageProfileIdentifierCollection = objMSH.getMessageProfileIdentifier();
		for(EI eiMsgPro : objMessageProfileIdentifierCollection)
		{
			if(eiMsgPro != null)
			{
				System.out.println("MessageProfileIdentifier::" + getValue(eiMsgPro));
			}
		}
		System.out.println("---------------------------------------------------------------------------------------------------------");
	}


	private void displaySFT(ISingleCollection<SFT> objSFTCollection)
	{
		//Retrieve contents of SFT segment
		for(SFT objSFT : objSFTCollection)
		{
			System.out.println("SFT::");
			if(objSFT != null)
			{
				XON objSoftwareVendorOrganization = objSFT.getSoftwareVendorOrganization();
				if(objSoftwareVendorOrganization != null)
				{
					System.out.println("SoftwareVendorOrganization::" + getValue(objSoftwareVendorOrganization));
				}
				ST objSoftwareCertifiedVersionOrReleaseNO = objSFT.getSoftwareCertifiedVersionOrReleaseNO();
				if(objSoftwareCertifiedVersionOrReleaseNO != null)
				{
					System.out.println("SoftwareCertifiedVersionOrReleaseNO::" + objSoftwareCertifiedVersionOrReleaseNO.getValue());
				}
				ST objSoftwareProductName = objSFT.getSoftwareProductName();
				if(objSoftwareProductName != null)
				{
					System.out.println("SoftwareProductName::" + objSoftwareProductName.getValue());
				}
				ST objSoftwareBinaryId = objSFT.getSoftwareBinaryId();
				if(objSoftwareBinaryId != null)
				{
					System.out.println("SoftwareBinaryId::" + objSoftwareBinaryId.getValue());
				}
				TX objSoftwareProductInformation = objSFT.getSoftwareProductInformation();
				if(objSoftwareProductInformation != null)
				{
					System.out.println("SoftwareProductInformation::" + objSoftwareProductInformation.getValue());
				}
				DTM objSoftwareInstallDate = objSFT.getSoftwareInstallDate();
				if(objSoftwareInstallDate != null)
				{
					System.out.println("SoftwareInstallDate::" + getValue(objSoftwareInstallDate));
				}
			}
			System.out.println("---------------------------------------------------------------------------------------------------------");
		}
	}

	private void displayPID(PID objPID)
	{
		System.out.println("PID::");
		SI objSetID_PID = objPID.getSetID_PID();
		if(objSetID_PID != null)
		{
			System.out.println("SetID_PID::" + objSetID_PID.getValue());
		}
		/*CX objPatientID = objPID.getPatientID();
		if(objPatientID != null)
		{
			System.out.println("PatientID::" + getValue(objPatientID));
		}*/
		ISingleCollection<CX> objPatientIdentifierListCollection = objPID.getPatientIdentifierList();
		for(CX cxPatientIdentifierList : objPatientIdentifierListCollection)
		{
			if(cxPatientIdentifierList != null)
			{
				System.out.println("PatientIdentifierList::" + getValue(cxPatientIdentifierList));
			}
		}
		/*ISingleCollection<CX> objAlternatePatientIDCollection = objPID.getAlternatePatientID();
		for(CX cxAlternatePatientID : objAlternatePatientIDCollection)
		{
			if(cxAlternatePatientID != null)
			{
				System.out.println("AlternatePatientID::" + getValue(cxAlternatePatientID));
			}
		}*/
		ISingleCollection<XPN> objPatientNameCollection = objPID.getPatientName();
		for(XPN xpnPatientName : objPatientNameCollection)
		{
			if(xpnPatientName != null)
			{
				System.out.println("PatientName::" + getValue(xpnPatientName));
			}
		}
		ISingleCollection<XPN> objMotherMaidenNameCollection = objPID.getMotherMaidenName();
		for(XPN xpnMotherMaidenName : objMotherMaidenNameCollection)
		{
			if(xpnMotherMaidenName != null)
			{
				System.out.println("MotherMaidenName::" + getValue(xpnMotherMaidenName));
			}
		}
		DTM objDateTimeOfBirth = objPID.getDateTimeOfBirth();
		if(objDateTimeOfBirth != null)
		{
			System.out.println("DateTimeOfBirth::" + getValue(objDateTimeOfBirth));
		}
		CWE objAdminiobjativeSex = objPID.getAdministrativeSex();
		if(objAdminiobjativeSex != null)
		{
			System.out.println("AdminiobjativeSex::" + objAdminiobjativeSex.getValue());
		}
		/*ISingleCollection<XPN> objPatientAliasCollection = objPID.getPatientAlias();
		for(XPN xpnPatientAlias : objPatientAliasCollection)
		{
			if(xpnPatientAlias != null)
			{
				System.out.println("PatientAlias::" + getValue(xpnPatientAlias));
			}
		}*/
		ISingleCollection<CWE> objRaceCollection = objPID.getRace();
		for(CWE ceRace : objRaceCollection)
		{
			if(ceRace != null)
			{
				System.out.println("Race::" + getValue(ceRace));
			}
		}
		ISingleCollection<XAD> objPatientAddressCollection = objPID.getPatientAddress();
		for(XAD xadPatientAddress : objPatientAddressCollection)
		{
			if(xadPatientAddress != null)
			{
				System.out.println("PatientAddress::" + getValue(xadPatientAddress));
			}
		}
		/*IS objCountyCode = objPID.getCountyCode();
		if(objCountyCode != null)
		{
			System.out.println("CountyCode::" + objCountyCode.getValue());
		}*/
		ISingleCollection<XTN> objPhoneNumberBusinessCollection = objPID.getPhoneNumberBusiness();
		for(XTN xtnPhoneNumberBusiness : objPhoneNumberBusinessCollection)
		{
			if(xtnPhoneNumberBusiness != null)
			{
				System.out.println("PhoneNumberBusiness::" + getValue(xtnPhoneNumberBusiness));
			}
		}
		CWE objPrimaryLanguage = objPID.getPrimaryLanguage();
		if(objPrimaryLanguage != null)
		{
			System.out.println("PrimaryLanguage::" + getValue(objPrimaryLanguage));
		}
		CWE objMaritalStatus = objPID.getMaritalStatus();
		if(objMaritalStatus != null)
		{
			System.out.println("MaritalStatus::" + getValue(objMaritalStatus));
		}
		CWE objReligion = objPID.getReligion();
		if(objReligion != null)
		{
			System.out.println("Religion::" + getValue(objReligion));
		}
		CX objPatientAccountNumber = objPID.getPatientAccountNumber();
		if(objPatientAccountNumber != null)
		{
			System.out.println("PatientAccountNumber::" + getValue(objPatientAccountNumber));
		}
		
		ISingleCollection<CX> objMotherIdentifierCollection = objPID.getMotherIdentifier();
		for(CX cxMotherIdentifier : objMotherIdentifierCollection)
		{
			if(cxMotherIdentifier != null)
			{
				System.out.println("MotherIdentifier::" + getValue(cxMotherIdentifier));
			}
		}
		ISingleCollection<CWE> objEthnicGroupCollection = objPID.getEthnicGroup();
		for(CWE ceEthnicGroup : objEthnicGroupCollection)
		{
			if(ceEthnicGroup != null)
			{
				System.out.println("EthnicGroup::" + getValue(ceEthnicGroup));
			}
		}
		ST objBirthPlace = objPID.getBirthPlace();
		if(objBirthPlace != null)
		{
			System.out.println("BirthPlace::" + objBirthPlace.getValue());
		}
		ID objMultipleBirthIndicator = objPID.getMultipleBirthIndicator();
		if(objMultipleBirthIndicator != null)
		{
			System.out.println("MultipleBirthIndicator::" + objMultipleBirthIndicator.getValue());
		}
		NM objBirthOrder = objPID.getBirthOrder();
		if(objBirthOrder != null)
		{
			System.out.println("BirthOrder::" + objBirthOrder.getValue());
		}
		ISingleCollection<CWE> objCitizenshipCollection = objPID.getCitizenship();
		for(CWE ceCitizenship : objCitizenshipCollection)
		{
			if(ceCitizenship != null)
			{
				System.out.println("Citizenship::" + getValue(ceCitizenship));
			}
		}
		CWE objVeteransMilitaryStatus = objPID.getVeteransMilitaryStatus();
		if(objVeteransMilitaryStatus != null)
		{
			System.out.println("VeteransMilitaryStatus::" + getValue(objVeteransMilitaryStatus));
		}
		
		DTM objPatientDeathDateTime = objPID.getPatientDeathDateTime();
		if(objPatientDeathDateTime != null)
		{
			System.out.println("PatientDeathDateTime::" + getValue(objPatientDeathDateTime));
		}
		ID objPatientDeathIndicator = objPID.getPatientDeathIndicator();
		if(objPatientDeathIndicator != null)
		{
			System.out.println("PatientDeathIndicator::" + objPatientDeathIndicator.getValue());
		}
		ID objIdentityUnknownIndicator = objPID.getIdentityUnknownIndicator();
		if(objIdentityUnknownIndicator != null)
		{
			System.out.println("IdentityUnknownIndicator::" + objIdentityUnknownIndicator.getValue());
		}
		ISingleCollection<CWE> objIdentityReliabilityCodeCollection = objPID.getIdentityReliabilityCode();
		for(CWE isIdentityReliabilityCode : objIdentityReliabilityCodeCollection)
		{
			if(isIdentityReliabilityCode != null)
			{
				System.out.println("IdentityReliabilityCode::" + isIdentityReliabilityCode.getValue());
			}
		}
		DTM objLastUpdateDateTime = objPID.getLastUpdateDateTime();
		if(objLastUpdateDateTime != null)
		{
			System.out.println("LastUpdateDateTime::" + getValue(objLastUpdateDateTime));
		}
		HD objLastUpdateFacility = objPID.getLastUpdateFacility();
		if(objLastUpdateFacility != null)
		{
			System.out.println("LastUpdateFacility::" + getValue(objLastUpdateFacility));
		}
		CWE objTaxonomicClassificationCode = objPID.getTaxonomicClassificationCode();
		if(objTaxonomicClassificationCode != null)
		{
			System.out.println("SpeciesCode::" + getValue(objTaxonomicClassificationCode));
		}
		CWE objBreedCode = objPID.getBreedCode();
		if(objBreedCode != null)
		{
			System.out.println("BreedCode::" + getValue(objBreedCode));
		}
		ST objStrain = objPID.getStrain();
		if(objStrain != null)
		{
			System.out.println("Strain::" + objStrain.getValue());
		}
		ISingleCollection<CWE> objProductionClassCodeCollection = objPID.getProductionClassCode();
		for(CWE ceProductionClassCode : objProductionClassCodeCollection)
		{
			if(ceProductionClassCode != null)
			{
				System.out.println("ProductionClassCode::" + getValue(ceProductionClassCode));
			}
		}
		ISingleCollection<CWE> objTribalCitizenshipCollection = objPID.getTribalCitizenship();
		for(CWE cweTribalCitizenship : objTribalCitizenshipCollection)
		{
			if(cweTribalCitizenship != null)
			{
				System.out.println("TribalCitizenship::" + getValue(cweTribalCitizenship));
			}
		}
		ISingleCollection<XTN> objPatientTelecommunicationIdentifier = objPID.getPatientTelecommunicationInformation();
		for(XTN xtnPatientTelecommunicationIdentifier : objPatientTelecommunicationIdentifier)
		{
			if(xtnPatientTelecommunicationIdentifier != null)
			{
				System.out.println("PatientTelecommunicationIdentifier::"+getValue(xtnPatientTelecommunicationIdentifier));
			}
		}
		System.out.println("---------------------------------------------------------------------------------------------------------");
	}


	private void displayPD1(PD1 objPD1)
	{
		System.out.println("PD1::");
		ISingleCollection<CWE> objLivingDependencyCollection = objPD1.getLivingDependency();
		for(CWE isLivingDependency : objLivingDependencyCollection)
		{
			if(isLivingDependency != null)
			{
				System.out.println("LivingDependency::" + isLivingDependency.getValue());
			}
		}
		CWE objLivingArrangement = objPD1.getLivingArrangement();
		if(objLivingArrangement != null)
		{
			System.out.println("LivingArrangement::" + objLivingArrangement.getValue());
		}
		ISingleCollection<XON> objPatientPrimaryFacilityCollection = objPD1.getPatientPrimaryFacility();
		for(XON xonPatientPrimaryFacility : objPatientPrimaryFacilityCollection)
		{
			if(xonPatientPrimaryFacility != null)
			{
				System.out.println("PatientPrimaryFacility::" + getValue(xonPatientPrimaryFacility));
			}
		}
		
		CWE objStudentIndicator = objPD1.getStudentIndicator();
		if(objStudentIndicator != null)
		{
			System.out.println("StudentIndicator::" + objStudentIndicator.getValue());
		}
		CWE objHandicap = objPD1.getHandicap();
		if(objHandicap != null)
		{
			System.out.println("Handicap::" + objHandicap.getValue());
		}
		CWE objLivingWillCode = objPD1.getLivingWillCode();
		if(objLivingWillCode != null)
		{
			System.out.println("LivingWillCode::" + objLivingWillCode.getValue());
		}
		CWE objOrganDonorCode = objPD1.getOrganDonorCode();
		if(objOrganDonorCode != null)
		{
			System.out.println("OrganDonorCode::" + objOrganDonorCode.getValue());
		}
		ID objSeparateBill = objPD1.getSeparateBill();
		if(objSeparateBill != null)
		{
			System.out.println("SeparateBill::" + objSeparateBill.getValue());
		}
		ISingleCollection<CX> objDuplicatePatientCollection = objPD1.getDuplicatePatient();
		for(CX cxDuplicatePatient : objDuplicatePatientCollection)
		{
			if(cxDuplicatePatient != null)
			{
				System.out.println("DuplicatePatient::" + getValue(cxDuplicatePatient));
			}
		}
		CWE objPublicityCode = objPD1.getPublicityCode();
		if(objPublicityCode != null)
		{
			System.out.println("PublicityCode::" + getValue(objPublicityCode));
		}
		ID objProtectionIndicator = objPD1.getProtectionIndicator();
		if(objProtectionIndicator != null)
		{
			System.out.println("ProtectionIndicator::" + objProtectionIndicator.getValue());
		}
		DT objProtectionIEDate = objPD1.getProtectionIEDate();
		if(objProtectionIEDate != null)
		{
			System.out.println("ProtectionIEDate::" + objProtectionIEDate.getValue());
		}
		ISingleCollection<XON> objPlaceOfWorshipCollection = objPD1.getPlaceOfWorship();
		for(XON xonPlaceOfWorship : objPlaceOfWorshipCollection)
		{
			if(xonPlaceOfWorship != null)
			{
				System.out.println("PlaceOfWorship::" + getValue(xonPlaceOfWorship));
			}
		}
		ISingleCollection<CWE> objAdvanceDirectiveCodeCollection = objPD1.getAdvanceDirectiveCode();
		for(CWE ceAdvanceDirectiveCode : objAdvanceDirectiveCodeCollection)
		{
			if(ceAdvanceDirectiveCode != null)
			{
				System.out.println("AdvanceDirectiveCode::" + getValue(ceAdvanceDirectiveCode));
			}
		}
		CWE objImmunizationRegistryStatus = objPD1.getImmunizationRegistryStatus();
		if(objImmunizationRegistryStatus != null)
		{
			System.out.println("ImmunizationRegistryStatus::" + objImmunizationRegistryStatus.getValue());
		}
		DT objImmunizationRSEffectiveDate = objPD1.getImmunizationRSEffectiveDate();
		if(objImmunizationRSEffectiveDate != null)
		{
			System.out.println("ImmunizationRSEffectiveDate::" + objImmunizationRSEffectiveDate.getValue());
		}
		DT objPublicityCodeEffectiveDate = objPD1.getPublicityCodeEffectiveDate();
		if(objPublicityCodeEffectiveDate != null)
		{
			System.out.println("PublicityCodeEffectiveDate::" + objPublicityCodeEffectiveDate.getValue());
		}
		CWE objMilitaryBranch = objPD1.getMilitaryBranch();
		if(objMilitaryBranch != null)
		{
			System.out.println("MilitaryBranch::" + objMilitaryBranch.getValue());
		}
		CWE objMilitaryRank_Grade = objPD1.getMilitaryRank_Grade();
		if(objMilitaryRank_Grade != null)
		{
			System.out.println("MilitaryRank_Grade::" + objMilitaryRank_Grade.getValue());
		}
		CWE objMilitaryStatus = objPD1.getMilitaryStatus();
		if(objMilitaryStatus != null)
		{
			System.out.println("MilitaryStatus::" + objMilitaryStatus.getValue());
		}
		DT objAdvanceDirectiveLastVerifiedDate =objPD1.getAdvanceDirectiveLastVerifiedDate();
		if(objAdvanceDirectiveLastVerifiedDate != null)
		{
			System.out.println("AdvanceDirectiveLastVerifiedDate::"+objAdvanceDirectiveLastVerifiedDate.getValue());
		}
		System.out.println("---------------------------------------------------------------------------------------------------------");
	}


	private void displayNTE(ISingleCollection<ISegment> objNTECollection)
	{
		System.out.println("NTE::");
		for(ISegment objSegment : objNTECollection)
		{
			NTE objNTE = (NTE)objSegment;

			SI objSetIDNTE = objNTE.getSetID_NTE();
			if(objSetIDNTE != null)
			{
				System.out.println("SetIDNTE::" + objSetIDNTE.getValue());
			}
			ID objSourceofComment = objNTE.getSourceOfComment();
			if(objSourceofComment != null)
			{
				System.out.println("SourceofComment::" + objSourceofComment.getValue());
			}
			ISingleCollection<FT> objCommentCollection = objNTE.getComment();
			for(FT objFT : objCommentCollection)
			{
				if(objFT != null)
				{
					System.out.println("Comment::" + objFT.getValue());
				}
			}
			CWE objCommentType = objNTE.getCommentType();
			if(objCommentType != null)
			{
				System.out.println("CommentType::" + getValue(objCommentType));
			}
			XCN objEnteredBy = objNTE.getEnteredBy();
			if(objEnteredBy != null)
			{
				System.out.println("EnteredBy::"+getValue(objEnteredBy));
			}
			DTM objEnteredDateTime = objNTE.getEnteredDateTime();
			if(objEnteredDateTime != null)
			{
				System.out.println("EnteredDateTime::"+getValue(objEnteredDateTime));
			}
			DTM objEffectiveStartDate = objNTE.getEffectiveStartDate();
			if(objEffectiveStartDate != null)
			{
				System.out.println("EffectiveStartDate::"+getValue(objEffectiveStartDate));
			}
			DTM objExpirationDate = objNTE.getExpirationDate();
			if(objExpirationDate != null)
			{
				System.out.println("ExpirationDate::"+getValue(objExpirationDate));
			}
			System.out.println("---------------------------------------------------------------------------------------------------------");
		}
	}


	private void displayNK1(ISingleCollection<ISegment> objNK1Collection)
	{
		System.out.println("NK1::");
		for(ISegment objSegment : objNK1Collection)
		{
			NK1 objNK1 = (NK1)objSegment;

			SI objSetIDNK1 = objNK1.getSetIDNK1();
			if(objSetIDNK1 != null)
			{
				System.out.println("SetIDNK1::" + objSetIDNK1.getValue());
			}
			ISingleCollection<XPN> objNameCollection = objNK1.getNameOFNextKin();
			for(XPN objXPN : objNameCollection)
			{
				if(objXPN != null)
				{
					System.out.println("NameCollection::" + getValue(objXPN));
				}
			}
			CWE objRelationship = objNK1.getRelationship();
			if(objRelationship != null)
			{
				System.out.println("Relationship::" + getValue(objRelationship));
			}
			ISingleCollection<XAD> objAddressCollection = objNK1.getAddress();
			for(XAD objXAD : objAddressCollection)
			{
				if(objXAD != null)
				{
					System.out.println("Address::" + getValue(objXAD));
				}
			}
			ISingleCollection<XTN> objPhoneNumberCollection = objNK1.getPhoneNumber();
			for(XTN objXTN : objPhoneNumberCollection)
			{
				if(objXTN != null)
				{
					System.out.println("PhoneNumber::" + getValue(objXTN));
				}
			}
			ISingleCollection<XTN> objBusinessPhoneNumberCollection = objNK1.getBusinessPhoneNumber();
			for(XTN objXTN : objBusinessPhoneNumberCollection)
			{
				if(objXTN != null)
				{
					System.out.println("BusinessPhoneNumber::" + getValue(objXTN));
				}
			}
			CWE objContactRole = objNK1.getContactRole();
			if(objContactRole != null)
			{
				System.out.println("ContactRole::" + getValue(objContactRole));
			}
			DT objStartDate = objNK1.getStartDate();
			if(objStartDate != null)
			{
				System.out.println("StartDate::" + objStartDate.getValue());
			}
			DT objEndDate = objNK1.getEndDate();
			if(objEndDate != null)
			{
				System.out.println("EndDate::" + objEndDate.getValue());
			}
			ST objNextOfKinAssociatedPartiesJobTitle = objNK1.getNextOfKinAssociatedPartiesJobTitle();
			if(objNextOfKinAssociatedPartiesJobTitle != null)
			{
				System.out.println("NextOfKinAssociatedPartiesJobTitle::" + objNextOfKinAssociatedPartiesJobTitle.getValue());
			}
			JCC objNextOfKinAssociatedPartiesJobCodeClass = objNK1.getNextOfKinAssociatedPartiesJobCodeClass();
			if(objNextOfKinAssociatedPartiesJobCodeClass != null)
			{
				System.out.println("NextOfKinAssociatedPartiesJobCodeClass::" + getValue(objNextOfKinAssociatedPartiesJobCodeClass));
			}
			CX objNextOfKinAssociatedPartiesEmployeeNumber = objNK1.getNextOfKinAssociatedPartiesEmployeeNumber();
			if(objNextOfKinAssociatedPartiesEmployeeNumber != null)
			{
				System.out.println("NextOfKinAssociatedPartiesEmployeeNumber::" + getValue(objNextOfKinAssociatedPartiesEmployeeNumber));
			}
			ISingleCollection<XON> objOrganizationNameNK1 = objNK1.getOrganizationNameNK1();
			for(XON objXON : objOrganizationNameNK1)
			{
				if(objXON != null)
				{
					System.out.println("OrganizationNameNK1::" + getValue(objXON));
				}
			}
			CWE objMaritalStatus = objNK1.getMaritalStatus();
			if(objMaritalStatus != null)
			{
				System.out.println("MaritalStatus::" + getValue(objMaritalStatus));
			}
			CWE objAdministrativeSex = objNK1.getAdministrativeSex();
			if(objAdministrativeSex != null)
			{
				System.out.println("AdministrativeSex::" + objAdministrativeSex.getValue());
			}
			DTM objDateTimeofBirth = objNK1.getDateTimeOfBirth();
			if(objDateTimeofBirth != null)
			{
				System.out.println("DateTimeofBirth::" + getValue(objDateTimeofBirth));
			}
			ISingleCollection<CWE> objLivingDependency = objNK1.getLivingDependency();
			for(CWE objIS : objLivingDependency)
			{
				if(objIS != null)
				{
					System.out.println("LivingDependency::" + objIS.getValue());
				}
			}
			ISingleCollection<CWE> objAmbulatoryStatus = objNK1.getAmbulatoryStatus();
			for(CWE objIS : objAmbulatoryStatus)
			{
				if(objIS != null)
				{
					System.out.println("AmbulatoryStatus::" + objIS.getValue());
				}
			}
			ISingleCollection<CWE> objCitizenship = objNK1.getCitizenship();
			for(CWE objCE : objCitizenship)
			{
				if(objCE != null)
				{
					System.out.println("Citizenship::" + getValue(objCE));
				}
			}
			CWE objPrimaryLanguage = objNK1.getPrimaryLanguage();
			if(objPrimaryLanguage != null)
			{
				System.out.println("PrimaryLanguage::" + getValue(objPrimaryLanguage));
			}
			CWE objLivingArrangement = objNK1.getLivingArrangement();
			if(objLivingArrangement != null)
			{
				System.out.println("LivingArrangement::" + objLivingArrangement.getValue());
			}
			CWE objPublicityCode = objNK1.getPublicityCode();
			if(objPublicityCode != null)
			{
				System.out.println("PublicityCode::" + getValue(objPublicityCode));
			}
			ID objProtectionIndicator = objNK1.getProtectionIndicator();
			if(objProtectionIndicator != null)
			{
				System.out.println("ProtectionIndicator::" + objProtectionIndicator.getValue());
			}
			CWE objStudentIndicator = objNK1.getStudentIndicator();
			if(objStudentIndicator != null)
			{
				System.out.println("StudentIndicator::" + objStudentIndicator.getValue());
			}
			CWE objReligion = objNK1.getReligion();
			if(objReligion != null)
			{
				System.out.println("Religion::" + getValue(objReligion));
			}
			ISingleCollection<XPN> objMothersMaidenName = objNK1.getMothersMaidenName();
			for(XPN objXPN : objMothersMaidenName)
			{
				if(objXPN != null)
				{
					System.out.println("MothersMaidenName::" + getValue(objXPN));
				}
			}
			CWE objNationality = objNK1.getNationality();
			if(objNationality != null)
			{
				System.out.println("Nationality::" + getValue(objNationality));
			}
			ISingleCollection<CWE> objEthnicGroup = objNK1.getEthnicGroup();
			for(CWE objCE : objEthnicGroup)
			{
				if(objCE != null)
				{
					System.out.println("EthnicGroup::" + getValue(objCE));
				}
			}
			ISingleCollection<CWE> objContactReason = objNK1.getContactReason();
			for(CWE objCE : objContactReason)
			{
				if(objCE != null)
				{
					System.out.println("ContactReason::" + getValue(objCE));
				}
			}
			ISingleCollection<XPN> objContactPersonsName = objNK1.getContactPersonsName();
			for(XPN objXPN : objContactPersonsName)
			{
				if(objXPN != null)
				{
					System.out.println("ContactPersonsName::" + getValue(objXPN));
				}
			}
			ISingleCollection<XTN> objContactPersonsTelephoneNumber = objNK1.getContactPersonsTelephoneNumber();
			for(XTN objXTN : objContactPersonsTelephoneNumber)
			{
				if(objXTN != null)
				{
					System.out.println("ContactPersonsTelephoneNumber::" + getValue(objXTN));
				}
			}
			ISingleCollection<XAD> objContactPersonsAddress = objNK1.getContactPersonsAddress();
			for(XAD objXAD : objContactPersonsAddress)
			{
				if(objXAD != null)
				{
					System.out.println("ContactPersonsAddress::" + getValue(objXAD));
				}
			}
			ISingleCollection<CX> objNextofKinAssociatedPartysIdentifiers = objNK1.getNextOfKinAssociatedPartysIdentifiers();
			for(CX objCX : objNextofKinAssociatedPartysIdentifiers)
			{
				if(objCX != null)
				{
					System.out.println("NextofKinAssociatedPartysIdentifiers::" + getValue(objCX));
				}
			}
			CWE objJobStatus = objNK1.getJobStatus();
			if(objJobStatus != null)
			{
				System.out.println("JobStatus::" + objJobStatus.getValue());
			}
			ISingleCollection<CWE> objRace = objNK1.getRace();
			for(CWE objCE : objRace)
			{
				if(objCE != null)
				{
					System.out.println("Race::" + getValue(objCE));
				}
			}
			CWE objHandicap = objNK1.getHandicap();
			if(objHandicap != null)
			{
				System.out.println("Handicap::" + objHandicap.getValue());
			}
			ST objContactPersonSocialSecurityNumber = objNK1.getContactPersonSocialSecurityNumber();
			if(objContactPersonSocialSecurityNumber != null)
			{
				System.out.println("ContactPersonSocialSecurityNumber::" + objContactPersonSocialSecurityNumber.getValue());
			}
			ST objNextofKinBirthPlace = objNK1.getNextOfKinBirthPlace();
			if(objNextofKinBirthPlace != null)
			{
				System.out.println("NextofKinBirthPlace::" + objNextofKinBirthPlace.getValue());
			}
			CWE objVIPIndicator = objNK1.getVIPIndicator();
			if(objVIPIndicator != null)
			{
				System.out.println("VIPIndicator::" + objVIPIndicator.getValue());
			}
			XTN objNextOfKinTelecommunicationInformation = objNK1.getNextOfKinTelecommunicationInformation();
			if(objNextOfKinTelecommunicationInformation != null)
			{
				System.out.println("NextOfKinTelecommunicationInformation::"+objNextOfKinTelecommunicationInformation.getValue());
			}
			XTN objContactPersonsTelecommunicationInformation = objNK1.getContactPersonsTelecommunicationInformation();
			if(objContactPersonsTelecommunicationInformation != null)
			{
				System.out.println("ContactPersonsTelecommunicationInformation::"+objContactPersonsTelecommunicationInformation.getValue());
			}
			System.out.println("---------------------------------------------------------------------------------------------------------");
		}
	}


	private void displayPV1(PV1 objPV1)
	{
		System.out.println("PV1::");
		SI objSetIDPV1 = objPV1.getSetID();
		if(objSetIDPV1 != null)
		{
			System.out.println("SetIDPV1::" + objSetIDPV1.getValue());
		}
		CWE objPatientClass = objPV1.getPatientClass();
		if(objPatientClass != null)
		{
			System.out.println("PatientClass::" + objPatientClass.getValue());
		}
		PL objAssignedPatientLocation = objPV1.getAssignedPatientLocation();
		if(objAssignedPatientLocation != null)
		{
			System.out.println("AssignedPatientLocation::" + getValue(objAssignedPatientLocation));
		}
		CWE objAdmissionType = objPV1.getAdmissionType();
		if(objAdmissionType != null)
		{
			System.out.println("AdmissionType::" + objAdmissionType.getValue());
		}
		CX objPreadmitNumber = objPV1.getPreAdmitNumber();
		if(objPreadmitNumber != null)
		{
			System.out.println("PreadmitNumber::" + getValue(objPreadmitNumber));
		}
		PL objPriorPatientLocation = objPV1.getPriorPatientLocation();
		if(objPriorPatientLocation != null)
		{
			System.out.println("PriorPatientLocation::" + getValue(objPriorPatientLocation));
		}
		ISingleCollection<XCN> objAttendingDoctorCollection = objPV1.getAttendingDoctor();
		for(XCN objXCN : objAttendingDoctorCollection)
		{
			if(objXCN != null)
			{
				System.out.println("AttendingDoctor::" + getValue(objXCN));
			}
		}
		ISingleCollection<XCN> objReferringDoctorCollection = objPV1.getReferringDoctor();
		for(XCN objXCN : objReferringDoctorCollection)
		{
			if(objXCN != null)
			{
				System.out.println("ReferringDoctor::" + getValue(objXCN));
			}
		}
		ISingleCollection<XCN> objConsultingDoctorCollection = objPV1.getConsultingDoctor();
		for(XCN objXCN : objConsultingDoctorCollection)
		{
			if(objXCN != null)
			{
				System.out.println("ConsultingDoctor::" + getValue(objXCN));
			}
		}
		CWE objHospitalService = objPV1.getHospitalService();
		if(objHospitalService != null)
		{
			System.out.println("HospitalService::" + objHospitalService.getValue());
		}
		PL objTemporaryLocation = objPV1.getTemporaryLocation();
		if(objTemporaryLocation != null)
		{
			System.out.println("TemporaryLocation::" + getValue(objTemporaryLocation));
		}
		CWE objPreadmitTestIndicator = objPV1.getPreAdmitTestIndicator();
		if(objPreadmitTestIndicator != null)
		{
			System.out.println("PreadmitTestIndicator::" + objPreadmitTestIndicator.getValue());
		}
		CWE objReadmissionIndicator = objPV1.getReAdmissionIndicator();
		if(objReadmissionIndicator != null)
		{
			System.out.println("ReadmissionIndicator::" + objReadmissionIndicator.getValue());
		}
		CWE objAdmitSource = objPV1.getAdmitSource();
		if(objAdmitSource != null)
		{
			System.out.println("AdmitSource::" + objAdmitSource.getValue());
		}
		ISingleCollection<CWE> objAmbulatoryStatusCollection = objPV1.getAmbulatoryStatus();
		for(CWE objIS : objAmbulatoryStatusCollection)
		{
			if(objIS != null)
			{
				System.out.println("AmbulatoryStatus::" + objIS.getValue());
			}
		}
		CWE objVIPIndicator = objPV1.getVipIndicator();
		if(objVIPIndicator != null)
		{
			System.out.println("VIPIndicator::" + objVIPIndicator.getValue());
		}
		ISingleCollection<XCN> objAdmittingDoctorCollection = objPV1.getAdmittingDoctor();
		for(XCN objXCN : objAdmittingDoctorCollection)
		{
			if(objXCN != null)
			{
				System.out.println("AdmittingDoctor::" + getValue(objXCN));
			}
		}
		CWE objPatientType = objPV1.getPatientType();
		if(objPatientType != null)
		{
			System.out.println("PatientType::" + objPatientType.getValue());
		}
		CX objVisitNumber = objPV1.getVisitNumber();
		if(objVisitNumber != null)
		{
			System.out.println("VisitNumber::" + getValue(objVisitNumber));
		}
		ISingleCollection<FC> objFinancialClassCollection = objPV1.getFinancialClass();
		for(FC objFC : objFinancialClassCollection)
		{
			if(objFC != null)
			{
				System.out.println("FinancialClass::" + getValue(objFC));
			}
		}
		CWE objChargePriceIndicator = objPV1.getChargePriceIndicator();
		if(objChargePriceIndicator != null)
		{
			System.out.println("ChargePriceIndicator::" + objChargePriceIndicator.getValue());
		}
		CWE objCourtesyCode = objPV1.getCourtesyCode();
		if(objCourtesyCode != null)
		{
			System.out.println("CourtesyCode::" + objCourtesyCode.getValue());
		}
		CWE objCreditRating = objPV1.getCreditRating();
		if(objCreditRating != null)
		{
			System.out.println("CreditRating::" + objCreditRating.getValue());
		}
		ISingleCollection<CWE> objContractCodeCollection = objPV1.getContractCode();
		for(CWE objIS : objContractCodeCollection)
		{
			if(objIS != null)
			{
				System.out.println("ContractCode::" + objIS.getValue());
			}
		}
		ISingleCollection<DT> objContractEffectiveDateCollection = objPV1.getContractEffectiveDate();
		for(DT objDT : objContractEffectiveDateCollection)
		{
			if(objDT != null)
			{
				System.out.println("ContractEffectiveDate::" + objDT.getValue());
			}
		}
		ISingleCollection<NM> objContractAmountCollection = objPV1.getContractAmount();
		for(NM objNM : objContractAmountCollection)
		{
			if(objNM != null)
			{
				System.out.println("ContractAmount::" + objNM.getValue());
			}
		}
		ISingleCollection<NM> objContractPeriodCollection = objPV1.getContractPeriod();
		for(NM objNM : objContractPeriodCollection)
		{
			if(objNM != null)
			{
				System.out.println("ContractPeriod::" + objNM.getValue());
			}
		}
		CWE objInterestCode = objPV1.getInterestCode();
		if(objInterestCode != null)
		{
			System.out.println("InterestCode::" + objInterestCode.getValue());
		}
		CWE objTransfertoBadDebtCode = objPV1.getTransferToBadDebtCode();
		if(objTransfertoBadDebtCode != null)
		{
			System.out.println("TransfertoBadDebtCode::" + objTransfertoBadDebtCode.getValue());
		}
		DT objTransfertoBadDebtDate = objPV1.getTransferToBadDebtDate();
		if(objTransfertoBadDebtDate != null)
		{
			System.out.println("TransfertoBadDebtDate::" + objTransfertoBadDebtDate.getValue());
		}
		CWE objBadDebtAgencyCode = objPV1.getBadDebtAgencyCode();
		if(objBadDebtAgencyCode != null)
		{
			System.out.println("BadDebtAgencyCode::" + objBadDebtAgencyCode.getValue());
		}
		NM objBadDebtTransferAmount = objPV1.getBadDebtTransferAmount();
		if(objBadDebtTransferAmount != null)
		{
			System.out.println("BadDebtTransferAmount::" + objBadDebtTransferAmount.getValue());
		}
		NM objBadDebtRecoveryAmount = objPV1.getBadDebtRecoveryAmount();
		if(objBadDebtRecoveryAmount != null)
		{
			System.out.println("BadDebtRecoveryAmount::" + objBadDebtRecoveryAmount.getValue());
		}
		CWE objDeleteAccountIndicator = objPV1.getDeleteAccountIndicator();
		if(objDeleteAccountIndicator != null)
		{
			System.out.println("DeleteAccountIndicator::" + objDeleteAccountIndicator.getValue());
		}
		DT objDeleteAccountDate = objPV1.getDeleteAccountDate();
		if(objDeleteAccountDate != null)
		{
			System.out.println("DeleteAccountDate::" + objDeleteAccountDate.getValue());
		}
		CWE objDischargeDisposition = objPV1.getDischargeDisposition();
		if(objDischargeDisposition != null)
		{
			System.out.println("DischargeDisposition::" + objDischargeDisposition.getValue());
		}
		DLD objDischargedtoLocation = objPV1.getDischargedToLocation();
		if(objDischargedtoLocation != null)
		{
			System.out.println("DischargedtoLocation::" + getValue(objDischargedtoLocation));
		}
		CWE objDietType = objPV1.getDietType();
		if(objDietType != null)
		{
			System.out.println("DietType::" + getValue(objDietType));
		}
		CWE objServicingFacility = objPV1.getServicingFacility();
		if(objServicingFacility != null)
		{
			System.out.println("ServicingFacility::" + objServicingFacility.getValue());
		}
		CWE objBedStatus = objPV1.getBedStatus();
		if(objBedStatus != null)
		{
			System.out.println("BedStatus::" + objBedStatus.getValue());
		}
		CWE objAccountStatus = objPV1.getAccountStatus();
		if(objAccountStatus != null)
		{
			System.out.println("AccountStatus::" + objAccountStatus.getValue());
		}
		PL objPendingLocation = objPV1.getPendingLocation();
		if(objPendingLocation != null)
		{
			System.out.println("PendingLocation::" + getValue(objPendingLocation));
		}
		PL objPriorTemporaryLocation = objPV1.getPriorTemporaryLocation();
		if(objPriorTemporaryLocation != null)
		{
			System.out.println("PriorTemporaryLocation::" + getValue(objPriorTemporaryLocation));
		}
		DTM objAdmitDateTime = objPV1.getAdmitDateOrTime();
		if(objAdmitDateTime != null)
		{
			System.out.println("AdmitDateTime::" + getValue(objAdmitDateTime));
		}
		ISingleCollection<DTM> objDischargeDateTimeCollection = objPV1.getDischargeDateOrTime();
		for(DTM objTS : objDischargeDateTimeCollection)
		{
			if(objTS != null)
			{
				System.out.println("DischargeDateTime::" + getValue(objTS));
			}
		}
		NM objCurrentPatientBalance = objPV1.getCurrentPatientBalance();
		if(objCurrentPatientBalance != null)
		{
			System.out.println("CurrentPatientBalance::" + objCurrentPatientBalance.getValue());
		}
		NM objTotalCharges = objPV1.getTotalCharges();
		if(objTotalCharges != null)
		{
			System.out.println("TotalCharges::" + objTotalCharges.getValue());
		}
		NM objTotalAdjustments = objPV1.getTotalAdjustments();
		if(objTotalAdjustments != null)
		{
			System.out.println("TotalAdjustments::" + objTotalAdjustments.getValue());
		}
		NM objTotalPayments = objPV1.getTotalPayments();
		if(objTotalPayments != null)
		{
			System.out.println("TotalPayments::" + objTotalPayments.getValue());
		}
		CX objAlternateVisitID = objPV1.getAlternateVisitID();
		if(objAlternateVisitID != null)
		{
			System.out.println("AlternateVisitID::" + getValue(objAlternateVisitID));
		}
		CWE objVisitIndicator = objPV1.getVisitIndicator();
		if(objVisitIndicator != null)
		{
			System.out.println("VisitIndicator::" + objVisitIndicator.getValue());
		}
		ISingleCollection<XCN> objOtherHealthcareProvider = objPV1.getOtherHealthCareProvider();
		for(XCN objXCN : objOtherHealthcareProvider)
		{
			if(objXCN != null)
			{
				System.out.println("OtherHealthcare::" + getValue(objXCN));
			}
		}
		ST objServiceEpisodeDescription = objPV1.getServiceEpisodeDescription();
		if(objServiceEpisodeDescription != null)
		{
			System.out.println("ServiceEpisodeDescription::"+objServiceEpisodeDescription.getValue());
		}
		CX objServiceEpisodeIdentifier = objPV1.getServiceEpisodeIdentifier();
		if(objServiceEpisodeIdentifier != null)
		{
			System.out.println("ServiceEpisodeIdentifier::"+objServiceEpisodeIdentifier.getValue());
		}
		System.out.println("---------------------------------------------------------------------------------------------------------");
	}


	private void displayPV2(PV2 objPV2)
	{
		System.out.println("PV2::");
		PL objPriorPendingLocation = objPV2.getPriorPendingLocation();
		if(objPriorPendingLocation != null)
		{
			System.out.println("PriorPendingLocation::" + getValue(objPriorPendingLocation));
		}
		CWE objAccommodationCode = objPV2.getAccomodationCode();
		if(objAccommodationCode != null)
		{
			System.out.println("AccommodationCode::" + getValue(objAccommodationCode));
		}
		CWE objAdmitReason = objPV2.getAdmitReason();
		if(objAdmitReason != null)
		{
			System.out.println("AdmitReason::" + getValue(objAdmitReason));
		}
		CWE objTransferReason = objPV2.getTransferReason();
		if(objTransferReason != null)
		{
			System.out.println("TransferReason::" + getValue(objTransferReason));
		}
		ISingleCollection<ST> objPatientValuablesCollection = objPV2.getPatientValuables();
		for(ST objST : objPatientValuablesCollection)
		{
			if(objST != null)
			{
				System.out.println("PatientValuables::" + objST.getValue());
			}
		}
		ST objPatientValuablesLocation = objPV2.getPatientValusblesLocation();
		if(objPatientValuablesLocation != null)
		{
			System.out.println("PatientValuablesLocation::" + objPatientValuablesLocation.getValue());
		}
		ISingleCollection<CWE> objVisitUserCodeCollection = objPV2.getVisitUserCode();
		for(CWE objIS : objVisitUserCodeCollection)
		{
			if(objIS != null)
			{
				System.out.println("VisitUserCode::" + objIS.getValue());
			}
		}
		DTM objExpectedAdmitDateTime = objPV2.getExpectedAdmitDateOrTime();
		if(objExpectedAdmitDateTime != null)
		{
			System.out.println("ExpectedAdmitDateTime::" + getValue(objExpectedAdmitDateTime));
		}
		DTM objExpectedDischargeDateTime = objPV2.getExpectedDischargeDateOrTime();
		if(objExpectedDischargeDateTime != null)
		{
			System.out.println("ExpectedDischargeDateTime::" + getValue(objExpectedDischargeDateTime));
		}
		NM objEstimatedLengthofInpatientStay = objPV2.getEstimatedLengthOfInPatientStay();
		if(objEstimatedLengthofInpatientStay != null)
		{
			System.out.println("EstimatedLengthofInpatientStay::" + objEstimatedLengthofInpatientStay.getValue());
		}
		NM objActualLengthofInpatientStay = objPV2.getActualLengthOfInPatientStay();
		if(objActualLengthofInpatientStay != null)
		{
			System.out.println("ActualLengthofInpatientStay::" + objActualLengthofInpatientStay.getValue());
		}
		ST objVisitDescription = objPV2.getVisitDescription();
		if(objVisitDescription != null)
		{
			System.out.println("VisitDescription::" + objVisitDescription.getValue());
		}
		ISingleCollection<XCN> objReferralSourceCodeCollection = objPV2.getReferralSourceCode();
		for(XCN objXCN : objReferralSourceCodeCollection)
		{
			if(objXCN != null)
			{
				System.out.println("ReferralSourceCode::" + getValue(objXCN));
			}
		}
		DT objPreviousServiceDate = objPV2.getPreviousServiceDate();
		if(objPreviousServiceDate != null)
		{
			System.out.println("PreviousServiceDate::" + objPreviousServiceDate.getValue());
		}
		ID objEmploymentIllnessRelatedIndicator = objPV2.getEmploymentIllnessRelatedIndicator();
		if(objEmploymentIllnessRelatedIndicator != null)
		{
			System.out.println("EmploymentIllnessRelatedIndicator::" + objEmploymentIllnessRelatedIndicator.getValue());
		}
		CWE objPurgeStatusCode = objPV2.getPurgeStatusCode();
		if(objPurgeStatusCode != null)
		{
			System.out.println("PurgeStatusCode::" + objPurgeStatusCode.getValue());
		}
		DT objPurgeStatusDate = objPV2.getPurgeStatusDate();
		if(objPurgeStatusDate != null)
		{
			System.out.println("PurgeStatusDate::" + objPurgeStatusDate.getValue());
		}
		CWE objSpecialProgramCode = objPV2.getSpecialProgramCode();
		if(objSpecialProgramCode != null)
		{
			System.out.println("SpecialProgramCode::" + objSpecialProgramCode.getValue());
		}
		ID objRetentionIndicator = objPV2.getRetentionIndicator();
		if(objRetentionIndicator != null)
		{
			System.out.println("RetentionIndicator::" + objRetentionIndicator.getValue());
		}
		NM objExpectedNumberofInsurancePlans = objPV2.getExpectedNumberOfInsurancePlans();
		if(objExpectedNumberofInsurancePlans != null)
		{
			System.out.println("ExpectedNumberofInsurancePlans::" + objExpectedNumberofInsurancePlans.getValue());
		}
		CWE objVisitPublicityCode = objPV2.getVisitPublicityCode();
		if(objVisitPublicityCode != null)
		{
			System.out.println("VisitPublicityCode::" + objVisitPublicityCode.getValue());
		}
		ID objVisitProtectionIndicator = objPV2.getVisitProtectionIndicator();
		if(objVisitProtectionIndicator != null)
		{
			System.out.println("VisitProtectionIndicator::" + objVisitProtectionIndicator.getValue());
		}
		ISingleCollection<XON> objClinicOrganizationNameCollection = objPV2.getClinicOrganizationName();
		for(XON objXON : objClinicOrganizationNameCollection)
		{
			if(objXON != null)
			{
				System.out.println("ClinicOrganizationName::" + getValue(objXON));
			}
		}
		CWE objPatientStatusCode = objPV2.getPatientStatusCode();
		if(objPatientStatusCode != null)
		{
			System.out.println("PatientStatusCode::" + objPatientStatusCode.getValue());
		}
		CWE objVisitPriorityCode = objPV2.getVisitPriorityCode();
		if(objVisitPriorityCode != null)
		{
			System.out.println("VisitPriorityCode::" + objVisitPriorityCode.getValue());
		}
		DT objPreviousTreatmentDate = objPV2.getPreviousTreatmentDate();
		if(objPreviousTreatmentDate != null)
		{
			System.out.println("PreviousTreatmentDate::" + objPreviousTreatmentDate.getValue());
		}
		CWE objExpectedDischargeDisposition = objPV2.getExpectedDischargeDisposition();
		if(objExpectedDischargeDisposition != null)
		{
			System.out.println("ExpectedDischargeDisposition::" + objExpectedDischargeDisposition.getValue());
		}
		DT objSignatureonFileDate = objPV2.getSignatureOnFileDate();
		if(objSignatureonFileDate != null)
		{
			System.out.println("SignatureonFileDate::" + objSignatureonFileDate.getValue());
		}
		DT objFirstSimilarIllnessDate = objPV2.getFirstSimilarIllnessDate();
		if(objFirstSimilarIllnessDate != null)
		{
			System.out.println("FirstSimilarIllnessDate::" + objFirstSimilarIllnessDate.getValue());
		}
		CWE objPatientChargeAdjustmentCode = objPV2.getPatientChargeAdjustmentCode();
		if(objPatientChargeAdjustmentCode != null)
		{
			System.out.println("PatientChargeAdjustmentCode::" + getValue(objPatientChargeAdjustmentCode));
		}
		CWE objRecurringServiceCode = objPV2.getRecurringServiceCode();
		if(objRecurringServiceCode != null)
		{
			System.out.println("RecurringServiceCode::" + objRecurringServiceCode.getValue());
		}
		ID objBillingMediaCode = objPV2.getBillingmediaCode();
		if(objBillingMediaCode != null)
		{
			System.out.println("BillingMediaCode::" + objBillingMediaCode.getValue());
		}
		DTM objExpectedSurgeryDateandTime = objPV2.getExpectedSurgeryDateAndTime();
		if(objExpectedSurgeryDateandTime != null)
		{
			System.out.println("ExpectedSurgeryDateandTime::" + getValue(objExpectedSurgeryDateandTime));
		}
		ID objMilitaryPartnershipCode = objPV2.getMilitaryPartnershipCode();
		if(objMilitaryPartnershipCode != null)
		{
			System.out.println("MilitaryPartnershipCode::" + objMilitaryPartnershipCode.getValue());
		}
		ID objMilitaryNonAvailabilityCode = objPV2.getMilitaryNonAvailabilityCode();
		if(objMilitaryNonAvailabilityCode != null)
		{
			System.out.println("MilitaryNonAvailabilityCode::" + objMilitaryNonAvailabilityCode.getValue());
		}
		ID objNewbornBabyIndicator = objPV2.getNewBornBabyIndictor();
		if(objNewbornBabyIndicator != null)
		{
			System.out.println("NewbornBabyIndicator::" + objNewbornBabyIndicator.getValue());
		}
		ID objBabyDetainedIndicator = objPV2.getBabyDetainedIndicator();
		if(objBabyDetainedIndicator != null)
		{
			System.out.println("BabyDetainedIndicator::" + objBabyDetainedIndicator.getValue());
		}
		CWE objModeofArrivalCode = objPV2.getModeOfArrivalCode();
		if(objModeofArrivalCode != null)
		{
			System.out.println("ModeofArrivalCode::" + getValue(objModeofArrivalCode));
		}
		ISingleCollection<CWE> objRecreationalDrugUseCodeCollection = objPV2.getRecreationalDrugUseCode();
		for(CWE objCE : objRecreationalDrugUseCodeCollection)
		{
			if(objCE != null)
			{
				System.out.println("RecreationalDrugUseCode::" + getValue(objCE));
			}
		}
		CWE objAdmissionLevelofCareCode = objPV2.getAdmissionLevelOfCareCode();
		if(objAdmissionLevelofCareCode != null)
		{
			System.out.println("AdmissionLevelofCareCode::" + getValue(objAdmissionLevelofCareCode));
		}
		ISingleCollection<CWE> objPrecautionCodeCollection = objPV2.getPrecautionCode();
		for(CWE objCE : objPrecautionCodeCollection)
		{
			if(objCE != null)
			{
				System.out.println("PrecautionCode::" + getValue(objCE));
			}
		}
		CWE objPatientConditionCode = objPV2.getPatientConditionCode();
		if(objPatientConditionCode != null)
		{
			System.out.println("PatientConditionCode::" + getValue(objPatientConditionCode));
		}
		CWE objLivingWillCode = objPV2.getLivingWillCode();
		if(objLivingWillCode != null)
		{
			System.out.println("LivingWillCode::" + objLivingWillCode.getValue());
		}
		CWE objOrganDonorCode = objPV2.getOrganDonorCode();
		if(objOrganDonorCode != null)
		{
			System.out.println("OrganDonorCode::" + objOrganDonorCode.getValue());
		}
		ISingleCollection<CWE> objAdvanceDirectiveCodeCollection = objPV2.getAdvanceDirectiveCode();
		for(CWE objCE : objAdvanceDirectiveCodeCollection)
		{
			if(objCE != null)
			{
				System.out.println("AdvanceDirectiveCode::" + getValue(objCE));
			}
		}
		DT objPatientStatusEffectiveDate = objPV2.getPatientStatusEffectiveDate();
		if(objPatientStatusEffectiveDate != null)
		{
			System.out.println("PatientStatusEffectiveDate::" + objPatientStatusEffectiveDate.getValue());
		}
		DTM objExpectedLOAReturnDateTime = objPV2.getExpectedLOAReturnDAteOrTime();
		if(objExpectedLOAReturnDateTime != null)
		{
			System.out.println("ExpectedLOAReturnDateTime::" + getValue(objExpectedLOAReturnDateTime));
		}
		DTM objExpectedPreadmissionTestingDateTime = objPV2.getExpectedPreAdmissionTestingDateOrTime();
		if(objExpectedPreadmissionTestingDateTime != null)
		{
			System.out.println("ExpectedPreadmissionTestingDateTime::" + getValue(objExpectedPreadmissionTestingDateTime));
		}
		ISingleCollection<CWE> objNotifyClergyCodeCollection = objPV2.getNotifyClergyCode();
		for(CWE objIS : objNotifyClergyCodeCollection)
		{
			if(objIS != null)
			{
				System.out.println("NotifyClergyCode::" + objIS.getValue());
			}
		}
		DT objAdvanceDirectiveLastVerifiedDate = objPV2.getAdvanceDirectiveLastVerifiedDate();
		if(objAdvanceDirectiveLastVerifiedDate != null)
		{
			System.out.println("AdvanceDirectiveLastVerifiedDate::"+objAdvanceDirectiveLastVerifiedDate.getValue());
		}
		System.out.println("---------------------------------------------------------------------------------------------------------");
	}


	private void displayORC(ORC objORC)
	{
		System.out.println("ORC::");
		ID objOrderControl = objORC.getOrderControl();
		if(objOrderControl != null)
		{
			System.out.println("OrderControl::" + objOrderControl.getValue());
		}
		EI objPlacerOrderNumber = objORC.getPlacerOrderNumber();
		if(objPlacerOrderNumber != null)
		{
			System.out.println("PlacerOrderNumber::" + objPlacerOrderNumber.getValue());
		}
		EI objFillerOrderNumber = objORC.getFillerOrderNumber();
		if(objFillerOrderNumber != null)
		{
			System.out.println("FillerOrderNumber::" + objFillerOrderNumber.getValue());
		}
		EIP objPlacerGroupNumber = objORC.getPlacerGroupNumber();
		if(objPlacerGroupNumber != null)
		{
			System.out.println("PlacerGroupNumber::" + objPlacerGroupNumber.getValue());
		}
		ID objOrderStatus = objORC.getOrderStatus();
		if(objOrderStatus != null)
		{
			System.out.println("OrderStatus::" + objOrderStatus.getValue());
		}
		ID objResponseFlag = objORC.getResponseFlag();
		if(objResponseFlag != null)
		{
			System.out.println("ResponseFlag::" + objResponseFlag.getValue());
		}
	
		EIP objParent = objORC.getParent();
		if(objParent != null)
		{
			System.out.println("Parent::" + getValue(objParent));
		}
		DTM objDateTimeofTransaction = objORC.getDateTimeOfTransaction();
		if(objDateTimeofTransaction != null)
		{
			System.out.println("DateTimeofTransaction::" + getValue(objDateTimeofTransaction));
		}
		ISingleCollection<XCN> objEnteredByCollection = objORC.getEnteredBy();
		for(XCN objXCN : objEnteredByCollection)
		{
			if(objXCN != null)
			{
				System.out.println("EnteredBy::" + getValue(objXCN));
			}
		}
		ISingleCollection<XCN> objVerifiedByCollection = objORC.getVerifiedBy();
		for(XCN objXCN : objVerifiedByCollection)
		{
			if(objXCN != null)
			{
				System.out.println("VerifiedBy::" + getValue(objXCN));
			}
		}
		ISingleCollection<XCN> objOrderingProviderCollection = objORC.getOrderingProvider();
		for(XCN objXCN : objOrderingProviderCollection)
		{
			if(objXCN != null)
			{
				System.out.println("OrderingProvider::" + getValue(objXCN));
			}
		}
		PL objEnterersLocation = objORC.getEntererLocation();
		if(objEnterersLocation != null)
		{
			System.out.println("EnterersLocation::" + getValue(objEnterersLocation));
		}
		ISingleCollection<XTN> objCallBackPhoneNumberCollection = objORC.getCallBackPhNo();
		for(XTN objXTN : objCallBackPhoneNumberCollection)
		{
			if(objXTN != null)
			{
				System.out.println("CallBackPhoneNumber::" + getValue(objXTN));
			}
		}
		DTM objOrderEffectiveDateTime = objORC.getOrderEffectiveDateTime();
		if(objOrderEffectiveDateTime != null)
		{
			System.out.println("OrderEffectiveDateTime::" + getValue(objOrderEffectiveDateTime));
		}
		CWE objOrderControlCodeReason = objORC.getOrderControlCodeReason();
		if(objOrderControlCodeReason != null)
		{
			System.out.println("OrderControlCodeReason::" + getValue(objOrderControlCodeReason));
		}
		CWE objEnteringOrganization = objORC.getEnteringOrganization();
		if(objEnteringOrganization != null)
		{
			System.out.println("EnteringOrganization::" + getValue(objEnteringOrganization));
		}
		CWE objEnteringDevice = objORC.getEnteringDevice();
		if(objEnteringDevice != null)
		{
			System.out.println("EnteringDevice::" + getValue(objEnteringDevice));
		}
		ISingleCollection<XCN> objActionByCollection = objORC.getActionBy();
		for(XCN objXCN : objActionByCollection)
		{
			if(objXCN != null)
			{
				System.out.println("ActionBy::" + getValue(objXCN));
			}
		}
		CWE objAdvancedBeneficiaryNoticeCode = objORC.getAdvancedBeneficiaryNoticeCode();
		if(objAdvancedBeneficiaryNoticeCode != null)
		{
			System.out.println("AdvancedBeneficiaryNoticeCode::" + getValue(objAdvancedBeneficiaryNoticeCode));
		}
		ISingleCollection<XON> objOrderingFacilityNameCollection = objORC.getOrderingFacilityName();
		for(XON objXON : objOrderingFacilityNameCollection)
		{
			if(objXON != null)
			{
				System.out.println("OrderingFacilityName::" + getValue(objXON));
			}
		}
		ISingleCollection<XAD> objOrderingFacilityAddressCollection = objORC.getOrderingFacilityAddress();
		for(XAD objXAD : objOrderingFacilityAddressCollection)
		{
			if(objXAD != null)
			{
				System.out.println("OrderingFacilityAddress::" + getValue(objXAD));
			}
		}
		ISingleCollection<XTN> objOrderingFacilityPhoneNumberCollection = objORC.getOrderingFacilityPhNo();
		for(XTN objXTNOrderingFacilityPhoneNumber : objOrderingFacilityPhoneNumberCollection)
		{
			if(objXTNOrderingFacilityPhoneNumber != null)
			{
				System.out.println("OrderingFacilityPhoneNumber::" + getValue(objXTNOrderingFacilityPhoneNumber));
			}
		}
		ISingleCollection<XAD> objOrderingProviderAddressCollection = objORC.getOrderingProviderAddress();
		for(XAD objXAD : objOrderingProviderAddressCollection)
		{
			if(objXAD != null)
			{
				System.out.println("OrderingProviderAddress::" + getValue(objXAD));
			}
		}
		CWE objOrderStatusModifier = objORC.getOrderStatusModifier();
		if(objOrderStatusModifier != null)
		{
			System.out.println("OrderStatusModifier::" + getValue(objOrderStatusModifier));
		}
		CWE objAdvancedBeneficiaryNoticeOverrideReason = objORC.getAdvancedBeneficiaryNoticeOverrideReason();
		if(objAdvancedBeneficiaryNoticeOverrideReason != null)
		{
			System.out.println("AdvancedBeneficiaryNoticeOverrideReason::" + getValue(objAdvancedBeneficiaryNoticeOverrideReason));
		}
		DTM objFillersExpectedAvailabilityDateTime = objORC.getFillersExpectedAvailabilityDateTime();
		if(objFillersExpectedAvailabilityDateTime != null)
		{
			System.out.println("FillersExpectedAvailabilityDateTime::" + getValue(objFillersExpectedAvailabilityDateTime));
		}
		CWE objConfidentialityCode = objORC.getConfidentialityCode();
		if(objConfidentialityCode != null)
		{
			System.out.println("ConfidentialityCode::" + getValue(objConfidentialityCode));
		}
		CWE objOrderType = objORC.getOrderType();
		if(objOrderType != null)
		{
			System.out.println("OrderType::" + getValue(objOrderType));
		}
		CNE objEntererAuthorizationMode = objORC.getEntererAuthorizationMode();
		if(objEntererAuthorizationMode != null)
		{
			System.out.println("EntererAuthorizationMode::" + getValue(objEntererAuthorizationMode));
		}
		CWE objParentUniversalServiceIdentifier = objORC.getParentUniversalServiceIdentifier();
		if(objParentUniversalServiceIdentifier != null)
		{
			System.out.println("ParentUniversalServiceIdentifier::"+objParentUniversalServiceIdentifier.getValue());
		}
		DT objAdvancedBeneficiaryNoticeDate = objORC.getAdvancedBeneficiaryNoticeDate();
		if(objAdvancedBeneficiaryNoticeDate != null)
		{
			System.out.println("AdvancedBeneficiaryNoticeDate::"+objAdvancedBeneficiaryNoticeDate.getValue());
		}
		ISingleCollection<CX> objAlternatePlacerOrderNumber =objORC.getAlternatePlacerOrderNumber();
		for(CX objCX : objAlternatePlacerOrderNumber)
		{
			if(objCX != null)
			{
				System.out.println("AlternatePlacerOrderNumber::"+objCX.getValue());
			}
		}
		ISingleCollection<CWE> objOrderWorkflowProfile = objORC.getOrderWorkflowProfile();
		for(CWE objCWE : objOrderWorkflowProfile)
		{
			if(objCWE != null)
			{
				System.out.println("OrderWorkflowProfile::"+objCWE.getValue());
			}
		}
		System.out.println("---------------------------------------------------------------------------------------------------------");
	}


	private void displayOBR(OBR objOBR)
	{
		System.out.println("OBR::");
		SI objSetIDOBR = objOBR.getSetID_OBR();
		if(objSetIDOBR != null)
		{
			System.out.println("SetIDOBR::" + objSetIDOBR.getValue());
		}
		EI objPlacerOrderNumber = objOBR.getPlacerOrderNumber();
		if(objPlacerOrderNumber != null)
		{
			System.out.println("PlacerOrderNumber::" + getValue(objPlacerOrderNumber));
		}
		EI objFillerOrderNumber = objOBR.getFillerOrderNumber();
		if(objFillerOrderNumber != null)
		{
			System.out.println("FillerOrderNumber::" + getValue(objFillerOrderNumber));
		}
		CWE objUniversalServiceIdentifier = objOBR.getUniversalServiceIdentifier();
		if(objUniversalServiceIdentifier != null)
		{
			System.out.println("UniversalServiceIdentifier::" + getValue(objUniversalServiceIdentifier));
		}
		
		DTM objObservationDateTime = objOBR.getObservationDateTime();
		if(objObservationDateTime != null)
		{
			System.out.println("ObservationDateTime::" + getValue(objObservationDateTime));
		}
		DTM objObservationEndDateTime = objOBR.getObservationEndDateTime();
		if(objObservationEndDateTime != null)
		{
			System.out.println("ObservationEndDateTime::" + getValue(objObservationEndDateTime));
		}
		CQ objCollectionVolume = objOBR.getCollectionVolume();
		if(objCollectionVolume != null)
		{
			System.out.println("CollectionVolume::" + getValue(objCollectionVolume));
		}
		ISingleCollection<XCN> objCollectorIdentifier = objOBR.getCollectorIdentifier();
		for(XCN objXCN : objCollectorIdentifier)
		{
			if(objXCN != null)
			{
				System.out.println("CollectorIdentifier::" + getValue(objXCN));
			}
		}
		ID objSpecimenActionCode = objOBR.getSpecimenActionCode();
		if(objSpecimenActionCode != null)
		{
			System.out.println("SpecimenActionCode::" + objSpecimenActionCode.getValue());
		}
		CWE objDangerCode = objOBR.getDangerCode();
		if(objDangerCode != null)
		{
			System.out.println("DangerCode::" + getValue(objDangerCode));
		}
		ISingleCollection<CWE> objRelevantClinicalInformation = objOBR.getRelevantClinicalInformation();
		for(CWE objCWE : objRelevantClinicalInformation)
		{
			if(objCWE != null)
			{
				System.out.println("RelevantClinicalInformation::" + objCWE.getValue());
			}
		}
		
		ISingleCollection<XCN> objOrderingProvider = objOBR.getOrderingProvider();
		for(XCN objXCN : objOrderingProvider)
		{
			if(objXCN != null)
			{
				System.out.println("OrderingProvider::" + getValue(objXCN));
			}
		}
		ISingleCollection<XTN> objOrderCallbackPhoneNumber = objOBR.getOrderCallbackPhoneNumber();
		for(XTN objXTN : objOrderCallbackPhoneNumber)
		{
			if(objXTN != null)
			{
				System.out.println("OrderCallbackPhoneNumber::" + getValue(objXTN));
			}
		}
		ST objPlacerField1 = objOBR.getPlacerField1();
		if(objPlacerField1 != null)
		{
			System.out.println("PlacerField1::" + objPlacerField1.getValue());
		}
		ST objPlacerField2 = objOBR.getPlacerField2();
		if(objPlacerField2 != null)
		{
			System.out.println("PlacerField2::" + objPlacerField2.getValue());
		}
		ST objFillerField1 = objOBR.getFillerField1();
		if(objFillerField1 != null)
		{
			System.out.println("FillerField1::" + objFillerField1.getValue());
		}
		ST objFillerField2 = objOBR.getFillerField2();
		if(objFillerField2 != null)
		{
			System.out.println("FillerField2::" + objFillerField2.getValue());
		}
		DTM objResultsRptStatusChngDateTime = objOBR.getResultsRptStatusChng_DateTime();
		if(objResultsRptStatusChngDateTime != null)
		{
			System.out.println("ResultsRptStatusChngDateTime::" + getValue(objResultsRptStatusChngDateTime));
		}
		MOC objChargetoPractice = objOBR.getChargetoPractice();
		if(objChargetoPractice != null)
		{
			System.out.println("ChargetoPractice::" + getValue(objChargetoPractice));
		}
		ID objDiagnosticServSectID = objOBR.getDiagnosticServSectID();
		if(objDiagnosticServSectID != null)
		{
			System.out.println("DiagnosticServSectID::" + objDiagnosticServSectID.getValue());
		}
		ID objResultStatus = objOBR.getResultStatus();
		if(objResultStatus != null)
		{
			System.out.println("ResultStatus::" + objResultStatus.getValue());
		}
		PRL objParentResult = objOBR.getParentResult();
		if(objParentResult != null)
		{
			System.out.println("ParentResult::" + getValue(objParentResult));
		}
		
		ISingleCollection<XCN> objResultCopiesTo = objOBR.getResultCopiesTo();
		for(XCN objXCN : objResultCopiesTo)
		{
			if(objXCN != null)
			{
				System.out.println("ResultCopiesTo::" + getValue(objXCN));
			}
		}
		EIP objParent = objOBR.getParent();
		if(objParent != null)
		{
			System.out.println("Parent::" + getValue(objParent));
		}
		ID objTransportationMode = objOBR.getTransportationMode();
		if(objTransportationMode != null)
		{
			System.out.println("TransportationMode::" + objTransportationMode.getValue());
		}
		ISingleCollection<CWE> objReasonforStudy = objOBR.getReasonforStudy();
		for(CWE objCE : objReasonforStudy)
		{
			if(objCE != null)
			{
				System.out.println("ReasonforStudy::" + getValue(objCE));
			}
		}
		NDL objPrincipalResultInterpreter = objOBR.getPrincipalResultInterpreter();
		if(objPrincipalResultInterpreter != null)
		{
			System.out.println("PrincipalResultInterpreter::" + getValue(objPrincipalResultInterpreter));
		}
		ISingleCollection<NDL> objAssistantResultInterpreter = objOBR.getAssistantResultInterpreter();
		for(NDL objNDL : objAssistantResultInterpreter)
		{
			if(objNDL != null)
			{
				System.out.println("AssistantResultInterpreter::" + getValue(objNDL));
			}
		}
		ISingleCollection<NDL> objTechnician = objOBR.getTechnician();
		for(NDL objNDL : objTechnician)
		{
			if(objNDL != null)
			{
				System.out.println("Technician::" + getValue(objNDL));
			}
		}
		ISingleCollection<NDL> objTranscriptionist = objOBR.getTranscriptionist();
		for(NDL objNDL : objTranscriptionist)
		{
			if(objNDL != null)
			{
				System.out.println("Transcriptionist::" + getValue(objNDL));
			}
		}
		DTM objScheduledDateTime = objOBR.getScheduledDateTime();
		if(objScheduledDateTime != null)
		{
			System.out.println("ScheduledDateTime::" + getValue(objScheduledDateTime));
		}
		NM objNumberofSampleContainers = objOBR.getNumberofSampleContainers();
		if(objNumberofSampleContainers != null)
		{
			System.out.println("NumberofSampleContainers::" + objNumberofSampleContainers.getValue());
		}
		ISingleCollection<CWE> objTransportLogisticsofCollectedSample = objOBR.getTransportLogisticsofCollectedSample();
		for(CWE objCE : objTransportLogisticsofCollectedSample)
		{
			if(objCE != null)
			{
				System.out.println("TransportLogisticsofCollectedSample::" + getValue(objCE));
			}
		}
		ISingleCollection<CWE> objCollectorsComment = objOBR.getCollectorComment();
		for(CWE objCE : objCollectorsComment)
		{
			if(objCE != null)
			{
				System.out.println("CollectorsComment::" + getValue(objCE));
			}
		}
		CWE objTransportArrangementResponsibility = objOBR.getTransportArrangementResponsibility();
		if(objTransportArrangementResponsibility != null)
		{
			System.out.println("TransportArrangementResponsibility::" + getValue(objTransportArrangementResponsibility));
		}
		ID objTransportArranged = objOBR.getTransportArranged();
		if(objTransportArranged != null)
		{
			System.out.println("TransportArranged::" + objTransportArranged.getValue());
		}
		ID objEscortRequired = objOBR.getEscortRequired();
		if(objEscortRequired != null)
		{
			System.out.println("EscortRequired::" + objEscortRequired.getValue());
		}
		ISingleCollection<CWE> objPlannedPatientTransportComment = objOBR.getPlannedPatientTransportComment();
		for(CWE objCE : objPlannedPatientTransportComment)
		{
			if(objCE != null)
			{
				System.out.println("PlannedPatientTransportComment::" + getValue(objCE));
			}
		}
		CNE objProcedureCode = objOBR.getProcedureCode();
		if(objProcedureCode != null)
		{
			System.out.println("ProcedureCode::" + getValue(objProcedureCode));
		}
		ISingleCollection<CNE> objProcedureCodeModifier = objOBR.getProcedureCodeModifier();
		for(CNE objCE : objProcedureCodeModifier)
		{
			if(objCE != null)
			{
				System.out.println("ProcedureCodeModifier::" + getValue(objCE));
			}
		}
		ISingleCollection<CWE> objPlacerSupplementalServiceInformation = objOBR.getPlacerSupplementalServiceInformation();
		for(CWE objCE : objPlacerSupplementalServiceInformation)
		{
			if(objCE != null)
			{
				System.out.println("PlacerSupplementalServiceInformation::" + getValue(objCE));
			}
		}
		ISingleCollection<CWE> objFillerSupplementalServiceInformation = objOBR.getFillerSupplementalServiceInformation();
		for(CWE objCE : objFillerSupplementalServiceInformation)
		{
			if(objCE != null)
			{
				System.out.println("FillerSupplementalServiceInformation::" + getValue(objCE));
			}
		}
		CWE objMedicallyNecessaryDuplicateProcedureReason = objOBR.getMedicallyNecessaryDuplicateProcedureReason();
		if(objMedicallyNecessaryDuplicateProcedureReason != null)
		{
			System.out.println("MedicallyNecessaryDuplicateProcedureReason::" + getValue(objMedicallyNecessaryDuplicateProcedureReason));
		}
		CWE objResultHandling = objOBR.getResultHandling();
		if(objResultHandling != null)
		{
			System.out.println("ResultHandling::" + objResultHandling.getValue());
		}
		CWE objParentUniversalServiceIdentifier = objOBR.getParentUniversalServiceIdentifier();
		if(objParentUniversalServiceIdentifier != null)
		{
			System.out.println("ParentUniversalServiceIdentifier::"+objParentUniversalServiceIdentifier.getValue());
		}
		EI objObservationGroupID = objOBR.getObservationGroupID();
		if(objObservationGroupID != null)
		{
			System.out.println("ObservationGroupID::"+objObservationGroupID.getValue());
		}
		EI objParentObservationGroupID = objOBR.getParentObservationGroupID();
		if(objParentObservationGroupID != null)
		{
			System.out.println("ParentObservationGroupID::"+objParentObservationGroupID.getValue());
		}
		ISingleCollection<CX> objAlternatePlacerOrderNumber = objOBR.getAlternatePlacerOrderNumber();
		for(CX objCX : objAlternatePlacerOrderNumber)
		{
			if(objCX != null)
			{
				System.out.println("AlternatePlacerOrderNumber::"+objCX.getValue());
			}
		}
		EIP objParentOrder = objOBR.getParentOrder();
		if(objParentOrder != null)
		{
			System.out.println("ParentOrder::"+objParentOrder.getValue());
		}
		System.out.println("---------------------------------------------------------------------------------------------------------");
	}


	private void displayTQ1(TQ1 objTQ1)
	{
		System.out.println("TQ1::");
		SI objSetIDTQ1 = objTQ1.getSetID_TQ1();
		if(objSetIDTQ1 != null)
		{
			System.out.println("SetIDTQ1::" + objSetIDTQ1.getValue());
		}
		CQ objQuantity = objTQ1.getQuantity();
		if(objQuantity != null)
		{
			System.out.println("Quantity::" + getValue(objQuantity));
		}
		ISingleCollection<RPT> objRepeatPatternCollection = objTQ1.getRepeatPattern();
		for(RPT objRPT : objRepeatPatternCollection)
		{
			if(objRPT != null)
			{
				System.out.println("RepeatPattern::" + getValue(objRPT));
			}
		}
		ISingleCollection<TM> objExplicitTimeCollection = objTQ1.getExplicitTime();
		for(TM objTM : objExplicitTimeCollection)
		{
			if(objTM != null)
			{
				System.out.println("ExplicitTime::" + objTM.getValue());
			}
		}
		ISingleCollection<CQ> objRelativeTimeandUnitsCollection = objTQ1.getRelativeTimeAndUnits();
		for(CQ objCQ : objRelativeTimeandUnitsCollection)
		{
			if(objCQ != null)
			{
				System.out.println("RelativeTimeandUnits::" + getValue(objCQ));
			}
		}
		CQ objServiceDuration = objTQ1.getServiceDuration();
		if(objServiceDuration != null)
		{
			System.out.println("ServiceDuration::" + getValue(objServiceDuration));
		}
		DTM objStartdatetime = objTQ1.getStartDateTime();
		if(objStartdatetime != null)
		{
			System.out.println("Startdatetime::" + getValue(objStartdatetime));
		}
		DTM objEnddatetime = objTQ1.getEndDateTime();
		if(objEnddatetime != null)
		{
			System.out.println("Enddatetime::" + getValue(objEnddatetime));
		}
		ISingleCollection<CWE> objPriorityCollection = objTQ1.getPriority();
		for(CWE objCWE : objPriorityCollection)
		{
			if(objCWE != null)
			{
				System.out.println("Priority::" + getValue(objCWE));
			}
		}
		TX objConditiontext = objTQ1.getConditionText();
		if(objConditiontext != null)
		{
			System.out.println("Conditiontext::" + objConditiontext.getValue());
		}
		TX objTextinstruction = objTQ1.getTextInstruction();
		if(objTextinstruction != null)
		{
			System.out.println("Textinstruction::" + objTextinstruction.getValue());
		}
		ID objConjunction = objTQ1.getConjunction();
		if(objConjunction != null)
		{
			System.out.println("Conjunction::" + objConjunction.getValue());
		}
		CQ objOccurrenceduration = objTQ1.getOccurrenceDuration();
		if(objOccurrenceduration != null)
		{
			System.out.println("Occurrenceduration::" + getValue(objOccurrenceduration));
		}
		NM objTotaloccurrences = objTQ1.getTotalOccurrences();
		if(objTotaloccurrences != null)
		{
			System.out.println("Totaloccurrences::" + objTotaloccurrences.getValue());
		}
		System.out.println("---------------------------------------------------------------------------------------------------------");
	}


	private void displayTQ2(ISingleCollection<ISegment> objTQ2Collection)
	{
		System.out.println("TQ2::");
		for(ISegment objSegment : objTQ2Collection)
		{
			TQ2 objTQ2 = (TQ2)objSegment;

			SI objSetIDTQ2 = objTQ2.getSetID_TQ2();
			if(objSetIDTQ2 != null)
			{
				System.out.println("SetIDTQ2::" + objSetIDTQ2.getValue());
			}
			ID objSequenceResultsFlag = objTQ2.getSequenceResultsFlag();
			if(objSequenceResultsFlag != null)
			{
				System.out.println("SequenceResultsFlag::" + objSequenceResultsFlag.getValue());
			}
			ISingleCollection<EI> objRelatedPlacerNumberCollection = objTQ2.getRelatedPlacerNo();
			for(EI objEI : objRelatedPlacerNumberCollection)
			{
				if(objEI != null)
				{
					System.out.println("RelatedPlacerNumber::" + getValue(objEI));
				}
			}
			ISingleCollection<EI> objRelatedFillerNumberCollection = objTQ2.getRelatedFillerNo();
			for(EI objEI : objRelatedFillerNumberCollection)
			{
				if(objEI != null)
				{
					System.out.println("RelatedFillerNumber::" + getValue(objEI));
				}
			}
			ISingleCollection<EI> objRelatedPlacerGroupNumberCollection = objTQ2.getRelatedPlacerGroupNo();
			for(EI objEI : objRelatedPlacerGroupNumberCollection)
			{
				if(objEI != null)
				{
					System.out.println("RelatedPlacerGroupNumber::" + getValue(objEI));
				}
			}
			ID objSequenceConditionCode = objTQ2.getSequenceConditionCode();
			if(objSequenceConditionCode != null)
			{
				System.out.println("SequenceConditionCode::" + objSequenceConditionCode.getValue());
			}
			ID objCyclicEntryExitIndicator = objTQ2.getCyclicEntryExitIndicator();
			if(objCyclicEntryExitIndicator != null)
			{
				System.out.println("CyclicEntryExitIndicator::" + objCyclicEntryExitIndicator.getValue());
			}
			CQ objSequenceConditionTimeInterval = objTQ2.getSequenceCondTimeInterval();
			if(objSequenceConditionTimeInterval != null)
			{
				System.out.println("SequenceConditionTimeInterval::" + getValue(objSequenceConditionTimeInterval));
			}
			NM objCyclicGroupMaximumNumberofRepeats = objTQ2.getCyclicGroupMaxNoOfRepeats();
			if(objCyclicGroupMaximumNumberofRepeats != null)
			{
				System.out.println("CyclicGroupMaximumNumberofRepeats::" + objCyclicGroupMaximumNumberofRepeats.getValue());
			}
			ID objSpecialServiceRequestRelationship = objTQ2.getSpecialServiceRequestRelationship();
			if(objSpecialServiceRequestRelationship != null)
			{
				System.out.println("SpecialServiceRequestRelationship::" + objSpecialServiceRequestRelationship.getValue());
			}
			System.out.println("---------------------------------------------------------------------------------------------------------");
		}
	}


	private void displayCTD(CTD objCTD)
	{
		System.out.println("CTD::");
		ISingleCollection<CWE> objContactRoleCollection = objCTD.getContactRole();
		for(CWE objCE : objContactRoleCollection)
		{
			if(objCE != null)
			{
				System.out.println("ContactRole::" + getValue(objCE));
			}
		}
		ISingleCollection<XPN> objContactNameCollection = objCTD.getContactName();
		for(XPN objXPN : objContactNameCollection)
		{
			if(objXPN != null)
			{
				System.out.println("ContactName::" + getValue(objXPN));
			}
		}
		ISingleCollection<XAD> objContactAddressCollection = objCTD.getContactAddress();
		for(XAD objXAD : objContactAddressCollection)
		{
			if(objXAD != null)
			{
				System.out.println("ContactAddress::" + getValue(objXAD));
			}
		}
		PL objContactLocation = objCTD.getContactLocation();
		if(objContactLocation != null)
		{
			System.out.println("ContactLocation::" + getValue(objContactLocation));
		}
		ISingleCollection<XTN> objContactCommunicationInformationCollection = objCTD.getContactCommunicationInformation();
		for(XTN objXTN : objContactCommunicationInformationCollection)
		{
			if(objXTN != null)
			{
				System.out.println("ContactCommunicationInformation::" + getValue(objXTN));
			}
		}
		CWE objPreferredMethodofContact = objCTD.getPreferredMethodContact();
		if(objPreferredMethodofContact != null)
		{
			System.out.println("PreferredMethodofContact::" + getValue(objPreferredMethodofContact));
		}
		ISingleCollection<PLN> objContactIdentifiersCollection = objCTD.getContactIdentifiers();
		for(PLN objPLN : objContactIdentifiersCollection)
		{
			if(objPLN != null)
			{
				System.out.println("ContactIdentifiers::" + getValue(objPLN));
			}
		}
		System.out.println("---------------------------------------------------------------------------------------------------------");
	}


	private void displayOBX(OBX objOBX)
	{
		System.out.println("OBX::");
		SI objSetIDOBX = objOBX.getSetID_OBX();
		if(objSetIDOBX != null)
		{
			System.out.println("SetIDOBX::" + objSetIDOBX.getValue());
		}
		ID objValueType = objOBX.getValueType();
		if(objValueType != null)
		{
			System.out.println("ValueType::" + objValueType.getValue());
		}
		CWE objObservationIdentifier = objOBX.getObservationIdentifier();
		if(objObservationIdentifier != null)
		{
			System.out.println("ObservationIdentifier::" + getValue(objObservationIdentifier));
		}
		OG objObservationSubID = objOBX.getObservationSubID();
		if(objObservationSubID != null)
		{
			System.out.println("ObservationSubID::" + objObservationSubID.getValue());
		}
		ISingleCollection<IDataType> objObservationValueCollection = objOBX.getObservationValue();
		for(IDataType objDataType : objObservationValueCollection)
		{
			if(objDataType != null)
			{
				System.out.println("ObservationValue::" + getValue(objDataType));
			}
		}
		CWE objUnits = objOBX.getUnits();
		if(objUnits != null)
		{
			System.out.println("Units::" + getValue(objUnits));
		}
		ST objReferencesRange = objOBX.getReferencesRange();
		if(objReferencesRange != null)
		{
			System.out.println("ReferencesRange::" + objReferencesRange.getValue());
		}
		ISingleCollection<CWE> objAbnormalFlagsCollection = objOBX.getAbnormalFlags();
		for(CWE objIS : objAbnormalFlagsCollection)
		{
			if(objIS != null)
			{
				System.out.println("AbnormalFlags::" + objIS.getValue());
			}
		}
		NM objProbability = objOBX.getProbability();
		if(objProbability != null)
		{
			System.out.println("Probability::" + objProbability.getValue());
		}
		ISingleCollection<ID> objNatureofAbnormalTestCollection = objOBX.getNatureOfAbnormalTest();
		for(ID objID : objNatureofAbnormalTestCollection)
		{
			if(objID != null)
			{
				System.out.println("NatureofAbnormalTest::" + objID.getValue());
			}
		}
		ID objObservationResultStatus = objOBX.getObservationResultStatus();
		if(objObservationResultStatus != null)
		{
			System.out.println("ObservationResultStatus::" + objObservationResultStatus.getValue());
		}
		DTM objEffectiveDateofReferenceRange = objOBX.getEffectiveDateOfReferenceRange();
		if(objEffectiveDateofReferenceRange != null)
		{
			System.out.println("EffectiveDateofReferenceRange::" + getValue(objEffectiveDateofReferenceRange));
		}
		ST objUserDefinedAccessChecks = objOBX.getUserDefinedAccessChecks();
		if(objUserDefinedAccessChecks != null)
		{
			System.out.println("UserDefinedAccessChecks::" + objUserDefinedAccessChecks.getValue());
		}
		DTM objDateTimeoftheObservation = objOBX.getDtTimeOfObservation();
		if(objDateTimeoftheObservation != null)
		{
			System.out.println("DateTimeoftheObservation::" + getValue(objDateTimeoftheObservation));
		}
		CWE objProducersID = objOBX.getProducersID();
		if(objProducersID != null)
		{
			System.out.println("ProducersID::" + getValue(objProducersID));
		}
		ISingleCollection<XCN> objResponsibleObserverCollection = objOBX.getResponsibleObserver();
		for(XCN objXCN : objResponsibleObserverCollection)
		{
			if(objXCN != null)
			{
				System.out.println("ResponsibleObserver::" + getValue(objXCN));
			}
		}
		ISingleCollection<CWE> objObservationMethodCollection = objOBX.getObservationMethod();
		for(CWE objCE : objObservationMethodCollection)
		{
			if(objCE != null)
			{
				System.out.println("ObservationMethod::" + getValue(objCE));
			}
		}
		ISingleCollection<EI> objEquipmentInstanceIdentifierCollection = objOBX.getEquipmentInstanceIdentifier();
		for(EI objEI : objEquipmentInstanceIdentifierCollection)
		{
			if(objEI != null)
			{
				System.out.println("EquipmentInstanceIdentifier::" + getValue(objEI));
			}
		}
		DTM objDateTimeoftheAnalysis = objOBX.getDtTimeOfAnalysis();
		if(objDateTimeoftheAnalysis != null)
		{
			System.out.println("DateTimeoftheAnalysis::" + getValue(objDateTimeoftheAnalysis));
		}
		ISingleCollection<CWE> objObservationSite =objOBX.getObservationSite();
		for(CWE objCWE : objObservationSite)
		{
			if(objCWE != null)
			{
				System.out.println("ObservationSite::"+objCWE.getValue());
			}
		}
		EI objObservationInstanceIdentifier = objOBX.getObservationInstanceIdentifier();
		if(objObservationInstanceIdentifier !=null)
		{
			System.out.println("ObservationInstanceIdentifier::"+objObservationInstanceIdentifier.getValue());
		}
		CNE objMoodCode = objOBX.getMoodCode();
		if(objMoodCode != null)
		{
			System.out.println("MoodCode::"+objMoodCode.getValue());
		}
		XON objPerformingOrganizationName = objOBX.getPerformingOrganizationName();
		if(objPerformingOrganizationName != null)
		{
			System.out.println("PerformingOrganizationName::"+objPerformingOrganizationName.getValue());
		}
		XAD objPerformingOrganizationAddress = objOBX.getPerformingOrganizationAddress();
		if(objPerformingOrganizationAddress != null)
		{
			System.out.println("PerformingOrganizationAddress::"+objPerformingOrganizationAddress.getValue());
		}
		XCN objPerformingOrganizationMedicalDirector =objOBX.getPerformingOrganizationMedicalDirector();
		if(objPerformingOrganizationMedicalDirector != null)
		{
			System.out.println("PerformingOrganizationMedicalDirector::"+objPerformingOrganizationMedicalDirector.getValue());
		}
		ID objPatientResultsReleaseCategory = objOBX.getPatientResultsReleaseCategory();
		if(objPatientResultsReleaseCategory != null)
		{
			System.out.println("PatientResultsReleaseCategory::"+objPatientResultsReleaseCategory.getValue());
		}
		CWE objRootCause = objOBX.getRootCause();
		if(objRootCause != null)
		{
			System.out.println("RootCause::"+objRootCause.getValue());
		}
		CWE objLocalProcessControl = objOBX.getLocalProcessControl();
		if(objLocalProcessControl != null)
		{
			System.out.println("LocalProcessControl:: "+objLocalProcessControl.getValue());
		}
		ID objObservationType = objOBX.getObservationType();
		if(objObservationType != null)
		{
			System.out.println("ObservationType::"+objObservationType.getValue());
		}
		ID objObservationSubType = objOBX.getObservationSubType();
		if(objObservationSubType != null)
		{
			System.out.println("ObservationSubType::"+objObservationSubType.getValue());
		}
		System.out.println("---------------------------------------------------------------------------------------------------------");
	}


	private void displayFT1(ISingleCollection<ISegment> objSegmentCollection)
	{
		for(ISegment objSegment : objSegmentCollection)
		{
			FT1 objFT1 = (FT1)objSegment;

			System.out.println("FT1::");
			SI objSetIDFT1 = objFT1.getSetID_FT1();
			if(objSetIDFT1 != null)
			{
				System.out.println("SetIDFT1::" + objSetIDFT1.getValue());
			}
			ST objTransactionID = objFT1.getTransactionID();
			if(objTransactionID != null)
			{
				System.out.println("TransactionID::" + objTransactionID.getValue());
			}
			ST objTransactionBatchID = objFT1.getTransactionBatchID();
			if(objTransactionBatchID != null)
			{
				System.out.println("TransactionBatchID::" + objTransactionBatchID.getValue());
			}
			DR objTransactionDate = objFT1.getTransactionDate();
			if(objTransactionDate != null)
			{
				System.out.println("TransactionDate::" + getValue(objTransactionDate));
			}
			DTM objTransactionPostingDate = objFT1.getTransactionPostingDate();
			if(objTransactionPostingDate != null)
			{
				System.out.println("TransactionPostingDate::" + getValue(objTransactionPostingDate));
			}
			CWE objTransactionType = objFT1.getTransactionType();
			if(objTransactionType != null)
			{
				System.out.println("TransactionType::" + objTransactionType.getValue());
			}
			CWE objTransactionCode = objFT1.getTransactionCode();
			if(objTransactionCode != null)
			{
				System.out.println("TransactionCode::" + getValue(objTransactionCode));
			}

			NM objTransactionQuantity = objFT1.getTransactionQuantity();
			if(objTransactionQuantity != null)
			{
				System.out.println("TransactionQuantity::" + objTransactionQuantity.getValue());
			}
			CP objTransactionAmountExtended = objFT1.getTransactionAmountExtended();
			if(objTransactionAmountExtended != null)
			{
				System.out.println("TransactionAmountExtended::" + getValue(objTransactionAmountExtended));
			}
			CP objTransactionAmountUnit = objFT1.getTransactionAmountUnit();
			if(objTransactionAmountUnit != null)
			{
				System.out.println("TransactionAmountUnit::" + getValue(objTransactionAmountUnit));
			}
			CWE objDepartmentCode = objFT1.getDepartmentCode();
			if(objDepartmentCode != null)
			{
				System.out.println("DepartmentCode::" + getValue(objDepartmentCode));
			}
			CWE objHealthPlanID = objFT1.getHealthPlanID();
			if(objHealthPlanID != null)
			{
				System.out.println("InsurancePlanID::" + getValue(objHealthPlanID));
			}
			CP objInsuranceAmount = objFT1.getInsuranceAmount();
			if(objInsuranceAmount != null)
			{
				System.out.println("InsuranceAmount::" + getValue(objInsuranceAmount));
			}
			PL objAssignedPatientLocation = objFT1.getAssignedPatientLocation();
			if(objAssignedPatientLocation != null)
			{
				System.out.println("AssignedPatientLocation::" + getValue(objAssignedPatientLocation));
			}
			CWE objFeeSchedule = objFT1.getFeeSchedule();
			if(objFeeSchedule != null)
			{
				System.out.println("FeeSchedule::" + objFeeSchedule.getValue());
			}
			CWE objPatientType = objFT1.getPatientType();
			if(objPatientType != null)
			{
				System.out.println("PatientType::" + objPatientType.getValue());
			}
			ISingleCollection<CWE> objDiagnosisCodeFT1 = objFT1.getDiagnosisCode_FT1();
			for(CWE objCE : objDiagnosisCodeFT1)
			{
				if(objCE != null)
				{
					System.out.println("DiagnosisCodeFT1::" + getValue(objCE));
				}
			}
			ISingleCollection<XCN> objPerformedByCode = objFT1.getPerformedByCode();
			for(XCN objXCN : objPerformedByCode)
			{
				if(objXCN != null)
				{
					System.out.println("PerformedByCode::" + getValue(objXCN));
				}
			}
			ISingleCollection<XCN> objOrderedByCode = objFT1.getOrderedByCode();
			for(XCN objXCN : objOrderedByCode)
			{
				if(objXCN != null)
				{
					System.out.println("OrderedByCode::" + getValue(objXCN));
				}
			}
			CP objUnitCost = objFT1.getUnitCost();
			if(objUnitCost != null)
			{
				System.out.println("UnitCost::" + getValue(objUnitCost));
			}
			EI objFillerOrderNumber = objFT1.getFillerOrderNumber();
			if(objFillerOrderNumber != null)
			{
				System.out.println("FillerOrderNumber::" + getValue(objFillerOrderNumber));
			}
			ISingleCollection<XCN> objEnteredByCode = objFT1.getEnteredByCode();
			for(XCN objXCN : objEnteredByCode)
			{
				if(objXCN != null)
				{
					System.out.println("EnteredByCode::" + getValue(objXCN));
				}
			}
			CNE objProcedureCode = objFT1.getProcedureCode();
			if(objProcedureCode != null)
			{
				System.out.println("ProcedureCode::" + getValue(objProcedureCode));
			}
			ISingleCollection<CNE> objProcedureCodeModifier = objFT1.getProcedureCodeModifier();
			for(CNE objCE : objProcedureCodeModifier)
			{
				if(objCE != null)
				{
					System.out.println("ProcedureCodeModifier::" + getValue(objCE));
				}
			}
			CWE objAdvancedBeneficiaryNoticeCode = objFT1.getAdvancedBeneficiaryNoticeCode();
			if(objAdvancedBeneficiaryNoticeCode != null)
			{
				System.out.println("AdvancedBeneficiaryNoticeCode::" + getValue(objAdvancedBeneficiaryNoticeCode));
			}
			CWE objMedicallyNecessaryDuplicateProcedureReason = objFT1.getMedicallyNecessaryDuplicateProcedureReason();
			if(objMedicallyNecessaryDuplicateProcedureReason != null)
			{
				System.out.println("MedicallyNecessaryDuplicateProcedureReason::" + getValue(objMedicallyNecessaryDuplicateProcedureReason));
			}
			CWE objNDCCode = objFT1.getNDCCode();
			if(objNDCCode != null)
			{
				System.out.println("NDCCode::" + getValue(objNDCCode));
			}
			CX objPaymentReferenceID = objFT1.getPaymentReferenceID();
			if(objPaymentReferenceID != null)
			{
				System.out.println("PaymentReferenceID::" + getValue(objPaymentReferenceID));
			}
			ISingleCollection<SI> objTransactionReferenceKey = objFT1.getTransactionReferenceKey();
			for(SI objSI : objTransactionReferenceKey)
			{
				if(objSI != null)
				{
					System.out.println("TransactionReferenceKey::" + objSI.getValue());
				}
			}
			ISingleCollection<XON> objPerformingFacility = objFT1.getPerformingFacility();
			for(XON objXON : objPerformingFacility)
			{
				if(objXON != null)
				{
					System.out.println("PerformingFacility::"+objXON.getValue());
				}
			}
			XON objOrderingFacility = objFT1.getOrderingFacility();
			if(objOrderingFacility != null)
			{
				System.out.println("OrderingFacility::"+objOrderingFacility.getValue());
			}
			CWE objItemNumber =objFT1.getItemNumber();
			if(objItemNumber != null)
			{
				System.out.println("ItemNumber::"+objItemNumber.getValue());
			}
			ST objModelNumber = objFT1.getModelNumber();
			if(objModelNumber != null)
			{
				System.out.println("ModelNumber::"+objModelNumber.getValue());
			}
			CWE objSpecialProcessingCode =objFT1.getSpecialProcessingCode();
			if(objSpecialProcessingCode != null)
			{
				System.out.println("SpecialProcessingCode::"+objSpecialProcessingCode.getValue());
			}
			CWE objClinicCode =objFT1.getClinicCode();
			if(objClinicCode != null)
			{
				System.out.println("ClinicCode::"+objClinicCode.getValue());
			}
			CX objReferralNumber =objFT1.getReferralNumber();
			if(objReferralNumber != null)
			{
				System.out.println("ReferralNumber::"+objReferralNumber.getValue());
			}
			CX objAuthorizationNumber = objFT1.getAuthorizationNumber();
			if(objAuthorizationNumber != null)
			{
				System.out.println("AuthorizationNumber::"+objAuthorizationNumber.getValue());
			}
			CWE objServiceProviderTaxonomyCode = objFT1.getServiceProviderTaxonomyCode();
			if(objServiceProviderTaxonomyCode != null)
			{
				System.out.println("ServiceProviderTaxonomyCode::"+objServiceProviderTaxonomyCode.getValue());
			}
			CWE objRevenueCode = objFT1.getRevenueCode();
			if(objRevenueCode != null)
			{
				System.out.println("RevenueCode::"+objRevenueCode.getValue());
			}
			ST objPrescriptionNumber = objFT1.getPrescriptionNumber();
			if(objPrescriptionNumber != null)
			{
				System.out.println("PrescriptionNumber::"+objPrescriptionNumber.getValue());
			}
			CQ objNDCQtyAndUOM = objFT1.getNDCQtyAndUOM();
			if(objNDCQtyAndUOM != null)
			{
				System.out.println("NDCQtyAndUOM::"+objNDCQtyAndUOM.getValue());
			}
			System.out.println("---------------------------------------------------------------------------------------------------------");
		}
	}


	private void displayCTI(ISingleCollection<ISegment> objCTICollection)
	{
		for(ISegment objSegment : objCTICollection)
		{
			CTI objCTI = (CTI)objSegment;

			System.out.println("CTI::");
			EI objSponsorStudyID = objCTI.getSponsorStudyID();
			if(objSponsorStudyID != null)
			{
				System.out.println("SponsorStudyID::" + getValue(objSponsorStudyID));
			}
			CWE objStudyPhaseIdentifier = objCTI.getStudyPhaseIdentifier();
			if(objStudyPhaseIdentifier != null)
			{
				System.out.println("StudyPhaseIdentifier::" + getValue(objStudyPhaseIdentifier));
			}
			CWE objStudyScheduledTimePoint = objCTI.getStudyScheduledTimePoint();
			if(objStudyScheduledTimePoint != null)
			{
				System.out.println("StudyScheduledTimePoint::" + getValue(objStudyScheduledTimePoint));
			}
			System.out.println("---------------------------------------------------------------------------------------------------------");
		}
	}


	private void displaySPM(SPM objSPM)
	{
		System.out.println("SPM::");
		SI objSetIDSPM = objSPM.getSetID_SPM();
		if(objSetIDSPM != null)
		{
			System.out.println("SetIDSPM::" + objSetIDSPM.getValue());
		}
		EIP objSpecimenID = objSPM.getSpecimenID();
		if(objSpecimenID != null)
		{
			System.out.println("SpecimenID::" + getValue(objSpecimenID));
		}
		ISingleCollection<EIP> objSpecimenParentIDs = objSPM.getSpecimenParentIDs();
		for(EIP objEIP : objSpecimenParentIDs)
		{
			if(objEIP != null)
			{
				System.out.println("SpecimenParentIDs::" + getValue(objEIP));
			}
		}
		CWE objSpecimenType = objSPM.getSpecimenType();
		if(objSpecimenType != null)
		{
			System.out.println("SpecimenType::" + getValue(objSpecimenType));
		}
		ISingleCollection<CWE> objSpecimenTypeModifier = objSPM.getSpecimenTypeModifier();
		for(CWE objCWE : objSpecimenTypeModifier)
		{
			if(objCWE != null)
			{
				System.out.println("SpecimenTypeModifier::" + getValue(objCWE));
			}
		}
		ISingleCollection<CWE> objSpecimenAdditives = objSPM.getSpecimenAdditives();
		for(CWE objCWE : objSpecimenAdditives)
		{
			if(objCWE != null)
			{
				System.out.println("SpecimenAdditives::" + getValue(objCWE));
			}
		}
		CWE objSpecimenCollectionMethod = objSPM.getSpecimenCollectionMethod();
		if(objSpecimenCollectionMethod != null)
		{
			System.out.println("SpecimenCollectionMethod::" + getValue(objSpecimenCollectionMethod));
		}
		CWE objSpecimenSourceSite = objSPM.getSpecimenSourceSite();
		if(objSpecimenSourceSite != null)
		{
			System.out.println("SpecimenSourceSite::" + getValue(objSpecimenSourceSite));
		}
		ISingleCollection<CWE> objSpecimenSourceSiteModifier = objSPM.getSpecimenSourceSiteModifier();
		for(CWE objCWE : objSpecimenSourceSiteModifier)
		{
			if(objCWE != null)
			{
				System.out.println("SpecimenSourceSiteModifier::" + getValue(objCWE));
			}
		}
		CWE objSpecimenCollectionSite = objSPM.getSpecimenCollectionSite();
		if(objSpecimenCollectionSite != null)
		{
			System.out.println("SpecimenCollectionSite::" + getValue(objSpecimenCollectionSite));
		}
		ISingleCollection<CWE> objSpecimenRole = objSPM.getSpecimenRole();
		for(CWE objCWE : objSpecimenRole)
		{
			if(objCWE != null)
			{
				System.out.println("SpecimenRole::" + getValue(objCWE));
			}
		}
		CQ objSpecimenCollectionAmount = objSPM.getSpecimenCollectionAmount();
		if(objSpecimenCollectionAmount != null)
		{
			System.out.println("SpecimenCollectionAmount::" + getValue(objSpecimenCollectionAmount));
		}
		NM objGroupedSpecimenCount = objSPM.getGroupedSpecimenCount();
		if(objGroupedSpecimenCount != null)
		{
			System.out.println("GroupedSpecimenCount::" + objGroupedSpecimenCount.getValue());
		}
		ISingleCollection<ST> objSpecimenDescription = objSPM.getSpecimenDescription();
		for(ST objST : objSpecimenDescription)
		{
			if(objST != null)
			{
				System.out.println("SpecimenDescription::" + objST.getValue());
			}
		}
		ISingleCollection<CWE> objSpecimenHandlingCode = objSPM.getSpecimenHandlingCode();
		for(CWE objCWE : objSpecimenHandlingCode)
		{
			if(objCWE != null)
			{
				System.out.println("SpecimenHandlingCode::" + getValue(objCWE));
			}
		}
		ISingleCollection<CWE> objSpecimenRiskCode = objSPM.getSpecimenRiskCode();
		for(CWE objCWE : objSpecimenRiskCode)
		{
			if(objCWE != null)
			{
				System.out.println("SpecimenRiskCode::" + getValue(objCWE));
			}
		}
		DR objSpecimenCollectionDateTime = objSPM.getSpecimenCollectionDateTime();
		if(objSpecimenCollectionDateTime != null)
		{
			System.out.println("SpecimenCollectionDateTime::" + objSpecimenCollectionDateTime.getValue());
		}
		DTM objSpecimenReceivedDateTime = objSPM.getSpecimenReceivedDateTime();
		if(objSpecimenReceivedDateTime != null)
		{
			System.out.println("SpecimenReceivedDateTime::" + getValue(objSpecimenReceivedDateTime));
		}
		DTM objSpecimenExpirationDateTime = objSPM.getSpecimenExpirationDateTime();
		if(objSpecimenExpirationDateTime != null)
		{
			System.out.println("SpecimenExpirationDateTime::" + getValue(objSpecimenExpirationDateTime));
		}
		ID objSpecimenAvailability = objSPM.getSpecimenAvailability();
		if(objSpecimenAvailability != null)
		{
			System.out.println("SpecimenAvailability::" + objSpecimenAvailability.getValue());
		}
		ISingleCollection<CWE> objSpecimenRejectReason = objSPM.getSpecimenRejectReason();
		for(CWE objCWE : objSpecimenRejectReason)
		{
			if(objCWE != null)
			{
				System.out.println("SpecimenRejectReason::" + getValue(objCWE));
			}
		}
		CWE objSpecimenQuality = objSPM.getSpecimenQuality();
		if(objSpecimenQuality != null)
		{
			System.out.println("SpecimenQuality::" + getValue(objSpecimenQuality));
		}
		CWE objSpecimenAppropriateness = objSPM.getSpecimenAppropriateness();
		if(objSpecimenAppropriateness != null)
		{
			System.out.println("SpecimenAppropriateness::" + getValue(objSpecimenAppropriateness));
		}
		ISingleCollection<CWE> objSpecimenCondition = objSPM.getSpecimenCondition();
		for(CWE objCWE : objSpecimenCondition)
		{
			if(objCWE != null)
			{
				System.out.println("SpecimenCondition::" + getValue(objCWE));
			}
		}
		CQ objSpecimenCurrentQuantity = objSPM.getSpecimenCurrentQuantity();
		if(objSpecimenCurrentQuantity != null)
		{
			System.out.println("SpecimenCurrentQuantity::" + getValue(objSpecimenCurrentQuantity));
		}
		NM objNumberofSpecimenContainers = objSPM.getNumberofSpecimenContainers();
		if(objNumberofSpecimenContainers != null)
		{
			System.out.println("NumberofSpecimenContainers::" + objNumberofSpecimenContainers.getValue());
		}
		CWE objContainerType = objSPM.getContainerType();
		if(objContainerType != null)
		{
			System.out.println("ContainerType::" + getValue(objContainerType));
		}
		CWE objContainerCondition = objSPM.getContainerCondition();
		if(objContainerCondition != null)
		{
			System.out.println("ContainerCondition::" + getValue(objContainerCondition));
		}
		CWE objSpecimenChildRole = objSPM.getSpecimenChildRole();
		if(objSpecimenChildRole != null)
		{
			System.out.println("SpecimenChildRole::" + getValue(objSpecimenChildRole));
		}
		ISingleCollection<CX> objAccessionID = objSPM.getAccessionID();
		for(CX objCX : objAccessionID)
		{
			if(objCX != null)
			{
				System.out.println("AccessionID::"+objCX.getValue());
			}
		}
		ISingleCollection<CX> objOtherSpecimenID = objSPM.getOtherSpecimenID();
		for(CX objCX : objOtherSpecimenID)
		{
			if(objCX != null)
			{
				System.out.println("OtherSpecimenID::"+objCX.getValue());
			}
		}
		EI objShipmentID = objSPM.getShipmentID();
		if(objShipmentID != null)
		{
			System.out.println("ShipmentID::"+objShipmentID.getValue());
		}
		System.out.println("---------------------------------------------------------------------------------------------------------");
	}


	private void displayOBX(ISingleCollection<ISegment> objOBXCollection)
	{
		for(ISegment objSegment : objOBXCollection)
		{
			OBX objOBX = (OBX)objSegment;

			System.out.println("OBX::");
			SI objSetIDOBX = objOBX.getSetID_OBX();
			if(objSetIDOBX != null)
			{
				System.out.println("SetIDOBX::" + objSetIDOBX.getValue());
			}
			ID objValueType = objOBX.getValueType();
			if(objValueType != null)
			{
				System.out.println("ValueType::" + objValueType.getValue());
			}
			CWE objObservationIdentifier = objOBX.getObservationIdentifier();
			if(objObservationIdentifier != null)
			{
				System.out.println("ObservationIdentifier::" + getValue(objObservationIdentifier));
			}
			OG objObservationSubID = objOBX.getObservationSubID();
			if(objObservationSubID != null)
			{
				System.out.println("ObservationSubID::" + objObservationSubID.getValue());
			}
			ISingleCollection<IDataType> objObservationValue = objOBX.getObservationValue();
			for(IDataType objDataType : objObservationValue)
			{
				if(objDataType != null)
				{
					System.out.println("ObservationValue::" + getValue(objDataType));
				}
			}
			CWE objUnits = objOBX.getUnits();
			if(objUnits != null)
			{
				System.out.println("Units::" + getValue(objUnits));
			}
			ST objReferencesRange = objOBX.getReferencesRange();
			if(objReferencesRange != null)
			{
				System.out.println("ReferencesRange::" + objReferencesRange.getValue());
			}
			ISingleCollection<CWE> objAbnormalFlags = objOBX.getAbnormalFlags();
			for(CWE objIS : objAbnormalFlags)
			{
				if(objIS != null)
				{
					System.out.println("AbnormalFlags::" + objIS.getValue());
				}
			}
			NM objProbability = objOBX.getProbability();
			if(objProbability != null)
			{
				System.out.println("Probability::" + objProbability.getValue());
			}
			ISingleCollection<ID> objNatureofAbnormalTest = objOBX.getNatureOfAbnormalTest();
			for(ID objID : objNatureofAbnormalTest)
			{
				if(objID != null)
				{
					System.out.println("NatureofAbnormalTest::" + objID.getValue());
				}
			}
			ID objObservationResultStatus = objOBX.getObservationResultStatus();
			if(objObservationResultStatus != null)
			{
				System.out.println("ObservationResultStatus::" + objObservationResultStatus.getValue());
			}
			DTM objEffectiveDateofReferenceRange = objOBX.getEffectiveDateOfReferenceRange();
			if(objEffectiveDateofReferenceRange != null)
			{
				System.out.println("EffectiveDateofReferenceRange::" + getValue(objEffectiveDateofReferenceRange));
			}
			ST objUserDefinedAccessChecks = objOBX.getUserDefinedAccessChecks();
			if(objUserDefinedAccessChecks != null)
			{
				System.out.println("UserDefinedAccessChecks::" + objUserDefinedAccessChecks.getValue());
			}
			DTM objDateTimeoftheObservation = objOBX.getDtTimeOfObservation();
			if(objDateTimeoftheObservation != null)
			{
				System.out.println("DateTimeoftheObservation::" + getValue(objDateTimeoftheObservation));
			}
			CWE objProducersID = objOBX.getProducersID();
			if(objProducersID != null)
			{
				System.out.println("ProducersID::" + getValue(objProducersID));
			}
			ISingleCollection<XCN> objResponsibleObserver = objOBX.getResponsibleObserver();
			for(XCN objXCN : objResponsibleObserver)
			{
				if(objXCN != null)
				{
					System.out.println("ResponsibleObserver::" + getValue(objXCN));
				}
			}
			ISingleCollection<CWE> objObservationMethod = objOBX.getObservationMethod();
			for(CWE objCE : objObservationMethod)
			{
				if(objCE != null)
				{
					System.out.println("ObservationMethod::" + getValue(objCE));
				}
			}
			ISingleCollection<EI> objEquipmentInstanceIdentifier = objOBX.getEquipmentInstanceIdentifier();
			for(EI objEI : objEquipmentInstanceIdentifier)
			{
				if(objEI != null)
				{
					System.out.println("EquipmentInstanceIdentifier::" + getValue(objEI));
				}
			}
			DTM objDateTimeoftheAnalysis = objOBX.getDtTimeOfAnalysis();
			if(objDateTimeoftheAnalysis != null)
			{
				System.out.println("DateTimeoftheAnalysis::" + getValue(objDateTimeoftheAnalysis));
			}
			ISingleCollection<CWE> objObservationSite =objOBX.getObservationSite();
			for(CWE objCWE : objObservationSite)
			{
				if(objCWE != null)
				{
					System.out.println("ObservationSite::"+objCWE.getValue());
				}
			}
			EI objObservationInstanceIdentifier = objOBX.getObservationInstanceIdentifier();
			if(objObservationInstanceIdentifier !=null)
			{
				System.out.println("ObservationInstanceIdentifier::"+objObservationInstanceIdentifier.getValue());
			}
			CNE objMoodCode = objOBX.getMoodCode();
			if(objMoodCode != null)
			{
				System.out.println("MoodCode::"+objMoodCode.getValue());
			}
			XON objPerformingOrganizationName = objOBX.getPerformingOrganizationName();
			if(objPerformingOrganizationName != null)
			{
				System.out.println("PerformingOrganizationName::"+objPerformingOrganizationName.getValue());
			}
			XAD objPerformingOrganizationAddress = objOBX.getPerformingOrganizationAddress();
			if(objPerformingOrganizationAddress != null)
			{
				System.out.println("PerformingOrganizationAddress::"+objPerformingOrganizationAddress.getValue());
			}
			XCN objPerformingOrganizationMedicalDirector =objOBX.getPerformingOrganizationMedicalDirector();
			if(objPerformingOrganizationMedicalDirector != null)
			{
				System.out.println("PerformingOrganizationMedicalDirector::"+objPerformingOrganizationMedicalDirector.getValue());
			}
			ID objPatientResultsReleaseCategory = objOBX.getPatientResultsReleaseCategory();
			if(objPatientResultsReleaseCategory != null)
			{
				System.out.println("PatientResultsReleaseCategory::"+objPatientResultsReleaseCategory.getValue());
			}
			CWE objRootCause = objOBX.getRootCause();
			if(objRootCause != null)
			{
				System.out.println("RootCause::"+objRootCause.getValue());
			}
			CWE objLocalProcessControl = objOBX.getLocalProcessControl();
			if(objLocalProcessControl != null)
			{
				System.out.println("LocalProcessControl:: "+objLocalProcessControl.getValue());
			}
			ID objObservationType = objOBX.getObservationType();
			if(objObservationType != null)
			{
				System.out.println("ObservationType::"+objObservationType.getValue());
			}
			ID objObservationSubType = objOBX.getObservationSubType();
			if(objObservationSubType != null)
			{
				System.out.println("ObservationSubType::"+objObservationSubType.getValue());
			}
			System.out.println("---------------------------------------------------------------------------------------------------------");
		}
	}


	private void displayDSC(DSC objDSC)
	{
		System.out.println("DSC::");
		ST objContiPointer = objDSC.getContinuationPointer();
		if(objContiPointer != null)
		{
			System.out.println("ContinuationPointer::" + objContiPointer.getValue());
		}
		ID objContinuationStyle = objDSC.getContinuationStyle();
		if(objContinuationStyle != null)
		{
			System.out.println("ContinuationStyle::" + objContinuationStyle.getValue());
		}
		System.out.println("---------------------------------------------------------------------------------------------------------");
	}

	private void populateMessage(ORU_R01 objORU_R01)  
	{ 
		//MSH Segment
		MSH objMSH = populateMSH();
		objORU_R01.setHeader(objMSH);

		//SFT segment
		SFT objSFT =populateSFT();
		objORU_R01.addSoftwareSegment(objSFT);
		
		//UAC Segment
		UAC objUAC=populateUAC();
		objORU_R01.setUserAuthenticationCredentialSegment(objUAC);

		IMap objMessageMap = MessageMapReader.createInstance().getMessageMap(EnumMessageCode.ORU, EnumTriggerEvent.R01);

		IMap objPatientResultGroupMap = objMessageMap.getGroupMap(EnumSegments.HL7_GROUP_PATIENT_RESULT);

		IGroup objPatientResultGroup = new Group(EnumSegments.HL7_GROUP_PATIENT_RESULT, objPatientResultGroupMap);

		IMap objPatientGroupMap = objPatientResultGroupMap.getGroupMap(EnumSegments.HL7_GROUP_PATIENT);

		IGroup objPatientGroup = new Group(EnumSegments.HL7_GROUP_PATIENT, objPatientGroupMap);

		//PID Segment
		PID objPID = populatePID();
		objPatientGroup.addSegment(EnumSegments.HL7_SEG_PID,objPID);

		//PD1 segment
		PD1 objPD1 = populatePD1();
		objPatientGroup.addSegment(EnumSegments.HL7_SEG_PD1,objPD1);

		//PRT Segment
		PRT objPRT = populatePRT();
		objPatientGroup.addSegment(EnumSegments.HL7_SEG_PRT, objPRT);

		//NTE segment
		NTE objNTE = populateNTE();
		objPatientGroup.addSegment(EnumSegments.HL7_SEG_NTE,objNTE);

		//NK1 segment
		NK1 objNK1 = populateNK1();
		objPatientGroup.addSegment(EnumSegments.HL7_SEG_NK1,objNK1);
		
		//ARV segment
		ARV objARV = populateARV();
		objPatientGroup.addSegment(EnumSegments.HL7_SEG_ARV,objARV);
		
		IMap objPatientObservationGroupMap = objPatientGroupMap.getGroupMap(EnumSegments.HL7_GROUP_PATIENT_OBSERVATION);

		IGroup objPatientObservationGroup = new Group(EnumSegments.HL7_GROUP_PATIENT_OBSERVATION, objPatientObservationGroupMap);
		
		//OBX Segment
		OBX objOBX = populateOBX();
		objPatientObservationGroup.addSegment(EnumSegments.HL7_SEG_OBX ,objOBX);
		
		//PRT Segment
		objPatientObservationGroup.addSegment(EnumSegments.HL7_SEG_PRT, objPRT);
		
		objPatientGroup.addGroup(EnumSegments.HL7_GROUP_PATIENT_OBSERVATION,objPatientObservationGroup);
		
		IMap objVisitGroupMap = objPatientGroupMap.getGroupMap(EnumSegments.HL7_GROUP_VISIT);

		IGroup objVisitGroup = new Group(EnumSegments.HL7_GROUP_VISIT, objVisitGroupMap);

		//PV1 segment
		PV1 objPV1 = populatePV1();
		objVisitGroup.addSegment(EnumSegments.HL7_SEG_PV1,objPV1);

		//PV2 segment
		PV2 objPV2 = populatePV2();
		objVisitGroup.addSegment(EnumSegments.HL7_SEG_PV2,objPV2);
		
		//PRT Segment
		objVisitGroup.addSegment(EnumSegments.HL7_SEG_PRT, objPRT);

		objPatientGroup.addGroup(EnumSegments.HL7_GROUP_VISIT,objVisitGroup);

		objPatientResultGroup.addGroup(EnumSegments.HL7_GROUP_PATIENT, objPatientGroup);

		IMap objOrderObservationGroupMap = objPatientResultGroupMap.getGroupMap(EnumSegments.HL7_GROUP_ORDER_OBSERVATION);

		IGroup objOrderObservationGroup = new Group(EnumSegments.HL7_GROUP_ORDER_OBSERVATION, objOrderObservationGroupMap);

		IMap objCommonOrderGroupMap = objOrderObservationGroup.getGroupMap(EnumSegments.HL7_GROUP_COMMON_ORDER);

		IGroup objCommonOrderGroup = new Group(EnumSegments.HL7_GROUP_COMMON_ORDER, objCommonOrderGroupMap);

		//ORC segment
		ORC objORC =populateORC();
		objCommonOrderGroup.addSegment(EnumSegments.HL7_SEG_ORC ,objORC);
		
		//PRT Segment
		objCommonOrderGroup.addSegment(EnumSegments.HL7_SEG_PRT, objPRT);
		
		IMap objOrderDocumnetGroupMap = objCommonOrderGroup.getGroupMap(EnumSegments.HL7_GROUP_ORDER_DOCUMENT);

		IGroup objOrderDocumnetGroup = new Group(EnumSegments.HL7_GROUP_ORDER_DOCUMENT, objOrderDocumnetGroupMap);

		//OBR Segment
		OBR objOBR = populateOBR();
		objOrderDocumnetGroup.addSegment(EnumSegments.HL7_SEG_OBR ,objOBR);
		
		//PRT Segment
		objOrderDocumnetGroup.addSegment(EnumSegments.HL7_SEG_PRT, objPRT);
		
		//TXA Segment
		TXA objTXA = populateTXA();
		objOrderDocumnetGroup.addSegment(EnumSegments.HL7_SEG_TXA ,objTXA);
		
		objOrderObservationGroup.addGroup(EnumSegments.HL7_GROUP_ORDER_DOCUMENT,objOrderDocumnetGroup);
		objOrderObservationGroup.addGroup(EnumSegments.HL7_GROUP_COMMON_ORDER,objCommonOrderGroup);
		
		//OBR Segment
		objOrderObservationGroup.addSegment(EnumSegments.HL7_SEG_OBR ,objOBR);
		//NTE segment
		objOrderObservationGroup.addSegment(EnumSegments.HL7_SEG_NTE ,objNTE);
		
		//PRT Segment
		objOrderObservationGroup.addSegment(EnumSegments.HL7_SEG_PRT, objPRT);

		IMap objTimingQuantityGroupMap = objPatientResultGroupMap.getGroupMap(EnumSegments.HL7_GROUP_TIMING_QUANTITY);

		IGroup objTimingQuantityGroup = new Group(EnumSegments.HL7_GROUP_TIMING_QUANTITY, objTimingQuantityGroupMap);

		//TQ1 segment
		TQ1 objTQ1 = populateTQ1();
		objTimingQuantityGroup.addSegment(EnumSegments.HL7_SEG_TQ1 ,objTQ1);

		//TQ2 segment
		TQ2 objTQ2 = populateTQ2();
		objTimingQuantityGroup.addSegment(EnumSegments.HL7_SEG_TQ2 ,objTQ2);

		objOrderObservationGroup.addGroup(EnumSegments.HL7_GROUP_TIMING_QUANTITY,objTimingQuantityGroup);

		//CTD segment
		CTD objCTD = populateCTD();
		objOrderObservationGroup.addSegment(EnumSegments.HL7_SEG_CTD,objCTD);

		IMap objObservationGroupMap = objPatientResultGroupMap.getGroupMap(EnumSegments.HL7_GROUP_OBSERVATION);

		IGroup objObservationGroup = new Group(EnumSegments.HL7_GROUP_OBSERVATION, objObservationGroupMap);

		//OBX Segment
		objObservationGroup.addSegment(EnumSegments.HL7_SEG_OBX ,objOBX);

		//PRT Segment
		objObservationGroup.addSegment(EnumSegments.HL7_SEG_PRT, objPRT);
		
		//NTE Segment
		objObservationGroup.addSegment(EnumSegments.HL7_SEG_NTE ,objNTE);

		objOrderObservationGroup.addGroup(EnumSegments.HL7_GROUP_OBSERVATION,objObservationGroup);

		//FT1
		FT1 objFT1 =populateFT1();
		objOrderObservationGroup.addSegment(EnumSegments.HL7_SEG_FT1,objFT1);

		//CTI
		CTI objCTI =populateCTI();
		objOrderObservationGroup.addSegment(EnumSegments.HL7_SEG_CTI,objCTI);

		IMap objSpecimenGroupMap = objPatientResultGroupMap.getGroupMap(EnumSegments.HL7_GROUP_SPECIMEN);

		IGroup objSpecimenGroup = new Group(EnumSegments.HL7_GROUP_SPECIMEN, objSpecimenGroupMap);

		//SPM Segment
		SPM objSPM =populateSPM();
		objSpecimenGroup.addSegment(EnumSegments.HL7_SEG_SPM, objSPM);
		

//		IMap objSpecimenObservationGroupMap = objSpecimenGroup.getGroupMap(EnumSegments.HL7_GROUP_SPECIMEN_OBSERVATION);
//		IGroup objSpecimenObservationGroup = new Group(EnumSegments.HL7_GROUP_SPECIMEN_OBSERVATION, objSpecimenObservationGroupMap);
//
//		//OBX Segment
//		objSpecimenObservationGroup.addSegment(EnumSegments.HL7_SEG_OBX, objOBX);
//		
//		//PRT Segment
//		objSpecimenObservationGroup.addSegment(EnumSegments.HL7_SEG_PRT, objPRT);
//		
//		objSpecimenGroup.addGroup(EnumSegments.HL7_GROUP_SPECIMEN_OBSERVATION,objSpecimenObservationGroup);
		objOrderObservationGroup.addGroup(EnumSegments.HL7_GROUP_SPECIMEN,objSpecimenGroup);

		objPatientResultGroup.addGroup(EnumSegments.HL7_GROUP_ORDER_OBSERVATION,objOrderObservationGroup);

		objORU_R01.addPatientResultGroup(objPatientResultGroup);

		//DSC Segment
		DSC objDSC =populateDSC();
		objORU_R01.setContinuationPointerSegment(objDSC);
	}

	private MSH populateMSH()
	{
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");
		
		HD objHD = new HD();
		objHD.setNamespaceId("NID");
		objHD.setUniversalId("Universal Id");
		objHD.setUniversalIdType("x400");
		
		MSH objMSH = new MSH();
		objMSH.setFieldSeparator('|');//ST
		objMSH.setEncodingChars('^','&','~','\\','#');//ST
		objMSH.setSendingApplication("NID", "Universal Id", "x400");//HD
		objMSH.setSendingFacility("NID", "Universal Id", "x400");//HD
		objMSH.setReceivingApplication("NID", "Universal Id", "x400");//HD
		objMSH.setReceivingFacility("NID", "Universal Id", "x400");//HD
		objMSH.setSecurity("Security");//ST
		objMSH.setMessageType("ADT","A01","ADT_A01");
		objMSH.setMessageControlID("MSG0001");//ST
		objMSH.setProcessingID("T", "T");//PT
		objMSH.setVersionID("2.5", null, null);//VID
		objMSH.setSequenceNumber("123");//NM
		objMSH.setContinuationPointer("ContinuationPointer");//ST
		objMSH.setAcceptAcknowledgmentType("AL");//ID
		objMSH.setApplicationAcknowledgmentType("AL");//ID
		objMSH.setCountryCode("CCD");//ID
		objMSH.addCharacterSet("ASCII");//ID
		objMSH.setPrincipalLanguageOfMessage(objCWE);//CE
		objMSH.setAlternateCharacterSetHandlingScheme("ISO 2022-1994");//ID
		objMSH.addMessageProfileIdentifier("Entity Identifier", "NAMESPACE", "UniversalId", "x500");//EI
		objMSH.setSendingResponsibleOrganization("strOrganizationName", objCWE, objAssigningAuthority, "strIdentifierTypeCode", objAssigningFacility, "strNameRepresentationCode", "strOrganizationIdentifier");
		objMSH.setReceivingResponsibleOrganization("strOrganizationName", objCWE, objHD, "strIdentifierTypeCode", objHD, "strNameRepresentationCode", "strOrganizationIdentifier");
		objMSH.setSendingNetworkAddress(objHD);
		objMSH.setReceivingNetworkAddress(objHD);
		return objMSH;
	}

	/**
	 * populates SFT Segment
	 * @return SFT
	 */
	public  SFT populateSFT()
	{
		//SFT segment
		SFT objSFT = new SFT();
		HD objHD = new HD();
		objHD.setNamespaceId("NID");
		objHD.setUniversalId("Universal Id");
		objHD.setUniversalIdType("x400");
		CWE objOrganizationNameTypeCode = new CWE();
		objSFT.setSoftwareVendorOrganization("strOrganizationName",objOrganizationNameTypeCode, objHD, "strIdentifierTypeCode", objHD, "strNameRepresentationCode", "strOrganizationIdentifier");/*;ganization("CDAC", "A", "234", "5", "NPI", objHD, "AM", objHD, "I", "text");//XON
*/		objSFT.setSoftwareCertifiedVersionOrReleaseNO("AFR-093232");
		objSFT.setSoftwareProductName("ZIRCON");
		objSFT.setSoftwareBinaryId("100110111");
		objSFT.setSoftwareProductInformation("Software Product Information");
		
		return objSFT;
	}
	/**
	 * Populate UAC Segment
	 * @return UAC
	 */
	public UAC populateUAC()
	{
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");
		
		HD objHD = new HD();
		objHD.setNamespaceId("REGAD1");
		objHD.setUniversalId("UI2");
		objHD.setUniversalIdType("GUID");
		
		ED objED = new ED();
		objED.setSourceApplication(objHD);
		objED.setTypeOfData("AP");
		objED.setDataSubtype("BASIC");
		objED.setEncoding("A");
		objED.setData("AB");
		
		UAC objUAC=new UAC();
		objUAC.setUserAuthenticationCredential(objED);
		
		objUAC.setUserAuthenticationCredentialTypeCode(objCWE);
		return objUAC;
	}

	/**
	 * populates PID Segment
	 * @return PID
	 */
	public PID populatePID()
	{
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");
		
		FN objFN = new FN();
		objFN.setSurname("AB");
		objFN.setOwnSurnamePrefix("AB");
		objFN.setOwnSurname("AB");
		objFN.setSurnamePrefixFromPartnerSpouse("AB");
		objFN.setSurnameFromPartnerSpouse("AB");
		
		HD objHD = new HD();
		objHD.setNamespaceId("REGAD1");
		objHD.setUniversalId("UI2");
		objHD.setUniversalIdType("GUID");
	
		XCN objXCN = new XCN();
		objXCN.setIdNumber("1");
		objXCN.setFamilyName(objFN);
		objXCN.setGivenName("Anurag");
		objXCN.setSecondNameOrInitials("Anu");
		objXCN.setSuffix("A");
		objXCN.setPrefix("K");
		objXCN.setSourceTable("297");
		objXCN.setAssigningAuthority(objHD);
		objXCN.setNameTypeCode("A");
		objXCN.setIdentifierCheckDigit("7");
		objXCN.setCheckDigitScheme("NPI");
		objXCN.setIdentifierTypeCode("AM");
		objXCN.setAssigningFacility(objHD);
		objXCN.setNameRepresentationCode("I");
		objXCN.setNameContext(objCWE);
		objXCN.setNameAssemblyOrder("F");
		objXCN.setEffectiveDate("20030303");
		objXCN.setExpirationDate("20030303");
		objXCN.setProfessionalSuffix("PS");
		objXCN.setAssigningJurisdiction(objCWE);
		objXCN.setAssigningAgencyOrDepartment(objCWE);
		objXCN.setSecurityCheck("strSecurityCheck");
		objXCN.setSecurityCheckScheme("strSecurityCheckScheme");
		
		SAD objSAD = new SAD();
		objSAD.setStreetOrMailingAddress("AB");
		objSAD.setStreetName("AB");
		objSAD.setDwellingNumber("AB");
		
		EI objEI = new EI();
		objEI.setEntityIdentifier("AB");
		objEI.setNamespaceId("AB");
		objEI.setUniversalId("AB");
		objEI.setUniversalIdType("DNS");
		
		XAD objXAD = new XAD();
		objXAD.setStreetAddress(objSAD);
		objXAD.setOtherDesignation("OD");
		objXAD.setCity("CTY");
		objXAD.setStateOrProvince("State");
		objXAD.setZipOrPostalCode("456789");
		objXAD.setCountry("IND");
		objXAD.setAddressType("BA");
		objXAD.setOtherGeographicDesignation("OD");
		objXAD.setCountyParishCode("1N");
		objXAD.setCensusTract("1289");
		objXAD.setAddressRepresentationCode("I");
		objXAD.setEffectiveDate(objEffectiveDate);
		objXAD.setExpirationDate(objExpirationDate);
		objXAD.setAddressee("ADDS");
		objXAD.setAddressIdentifier(objEI);
		objXAD.setAddressUsage("ADDU");
		objXAD.setBadAddressIndicator("BADDI");
		objXAD.setComment("CMT");
		objXAD.setCountyParishCode("INDPC");
		objXAD.setExpirationReason(objCWE);
		objXAD.setPreferenceOrder("PRFO");
		objXAD.setProtectionCode(objCWE);
		objXAD.setTemporaryIndicator("TEMPI");
		
		CX objCX = new CX();
		objCX.setIdNumber("1");
		objCX.setCheckDigit("8");
		objCX.setCheckDigitScheme("NPI");
		objCX.setAssigningAuthority(objHD);
		objCX.setIdentifierTypeCode("AN");
		objCX.setAssigningFacility(objHD);
		objCX.setEffectiveDate("20040304");
		objCX.setExpirationDate("20040305");
		objCX.setAssigningJurisdiction(objCWE);
		objCX.setAssigningAgencyOrDepartment(objCWE);
		objCX.setSecurityCheck("strSecurityCheck");
		objCX.setSecurityCheckScheme("strSecurityCheckScheme");
		
		XTN objXTN = new XTN();
		objXTN.setLocalNumber("Telephone Number");
		objXTN.setTelecommunicationUseCode("ORN");
		objXTN.setTelecommunicationEquipmentType("Internet");
		//objXTN.setEmailAddress("akjhsd@cdac.in");
		objXTN.setCountryCode("546");
		objXTN.setAreaCityCode("54321");
		objXTN.setLocalNumber("123456789");
		objXTN.setExtension("67890");
		objXTN.setAnyText("Any Text");
		objXTN.setExtensionPrefix("EP");
		objXTN.setSpeedDialCode("SDC");
		objXTN.setUnformattedTelephonenumber("1-800-Dentist");
		
		XPN objXPN = new XPN();
		objXPN.setFamilyName(objFN);
		objXPN.setGivenName("anurag");
		objXPN.setSecondNameOrInitials("kulk");
		objXPN.setSuffix("w");
		objXPN.setPrefix("p");
		objXPN.setNameTypeCode("A");
		objXPN.setNameRepresentationCode("I");
		objXPN.setNameContext(objCWE);
		objXPN.setNameAssemblyOrder("G");
		objXPN.setEffectiveDate("20040304");
		objXPN.setExpirationDate("20040304");
		objXPN.setProfessionalSuffix("TXT");
		objXPN.setCalledBy("strCalledBy");
		
		MO objPrice = new MO();
		objPrice.setQuantity("99");
		objPrice.setDenomination("USD");
		
		PL objPL = new PL();
		objPL.setPointOfCare(objHD);
		objPL.setRoom(objHD);
		objPL.setBed(objHD);
		objPL.setFacility(objHD);
		objPL.setLocationStatus("AB");
		objPL.setPersonLocationType("C");
		objPL.setBuilding("H");
		objPL.setFloor("AB");
		objPL.setLocationDescription("AB");
		objPL.setComprehensiveLocationIdentifier(objEI);
		objPL.setAssigningAuthorityForLocation(objHD);
		//PID Segment
		PID objPID = new PID();
		objPID.setSetID_PID("5");
		objPID.addPatientIdentifierList(objCX);//CX
		objPID.addPatientName(objXPN);//XPN
		objPID.addMotherMaidenName(objXPN);//XPN
		objPID.setAdministrativeSex(objCWE);
		objPID.addRace(objCWE);
		objPID.addPatientAddress(objXAD);//XAD
		objPID.addPhoneNumberHome(objXTN);//XTN
		objPID.addPhoneNumberBusiness(objXTN);//XTN
		objPID.setPrimaryLanguage(objCWE);
		objPID.setMaritalStatus(objCWE);
		objPID.setReligion(objCWE);
		objPID.setPatientAccountNumber(objCX);//CX
		objPID.addMotherIdentifier(objCX);//CX
		objPID.addEthnicGroup(objCWE);
		objPID.setBirthPlace("Birth Place");
		objPID.setMultipleBirthIndicator("Y");
		objPID.setBirthOrder("12");
		objPID.addCitizenship(objCWE);
		objPID.setVeteransMilitaryStatus(objCWE);
	
		objPID.setPatientDeathIndicator("Y");
		objPID.setIdentityUnknownIndicator("N");
		objPID.addIdentityReliabilityCode(objCWE);
		objPID.setLastUpdateFacility("NID", "UI", "GUID");
		objPID.setTaxonomicClassificationCode(objCWE);
		objPID.setBreedCode(objCWE);
		objPID.setStrain("Strain");
		objPID.addProductionClassCode(objCWE);
		objPID.addTribalCitizenship(objCWE);
		return objPID;
	}

	/**
	 * populates PD1 Segment
	 * @return PD1
	 */
	public PD1 populatePD1()
	{
		
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");
		
		FN objFN = new FN();
		objFN.setSurname("AB");
		objFN.setOwnSurnamePrefix("AB");
		objFN.setOwnSurname("AB");
		objFN.setSurnamePrefixFromPartnerSpouse("AB");
		objFN.setSurnameFromPartnerSpouse("AB");
		
		HD objHD = new HD();
		objHD.setNamespaceId("REGAD1");
		objHD.setUniversalId("UI2");
		objHD.setUniversalIdType("GUID");
	
		XCN objXCN = new XCN();
		objXCN.setIdNumber("1");
		objXCN.setFamilyName(objFN);
		objXCN.setGivenName("Anurag");
		objXCN.setSecondNameOrInitials("Anu");
		objXCN.setSuffix("A");
		objXCN.setPrefix("K");
		objXCN.setSourceTable("297");
		objXCN.setAssigningAuthority(objHD);
		objXCN.setNameTypeCode("A");
		objXCN.setIdentifierCheckDigit("7");
		objXCN.setCheckDigitScheme("NPI");
		objXCN.setIdentifierTypeCode("AM");
		objXCN.setAssigningFacility(objHD);
		objXCN.setNameRepresentationCode("I");
		objXCN.setNameContext(objCWE);
		objXCN.setNameAssemblyOrder("F");
		objXCN.setEffectiveDate("20030303");
		objXCN.setExpirationDate("20030303");
		objXCN.setProfessionalSuffix("PS");
		objXCN.setAssigningJurisdiction(objCWE);
		objXCN.setAssigningAgencyOrDepartment(objCWE);
		objXCN.setSecurityCheck("strSecurityCheck");
		objXCN.setSecurityCheckScheme("strSecurityCheckScheme");
		
		SAD objSAD = new SAD();
		objSAD.setStreetOrMailingAddress("AB");
		objSAD.setStreetName("AB");
		objSAD.setDwellingNumber("AB");
		
		EI objEI = new EI();
		objEI.setEntityIdentifier("AB");
		objEI.setNamespaceId("AB");
		objEI.setUniversalId("AB");
		objEI.setUniversalIdType("DNS");
		
		XAD objXAD = new XAD();
		objXAD.setStreetAddress(objSAD);
		objXAD.setOtherDesignation("OD");
		objXAD.setCity("CTY");
		objXAD.setStateOrProvince("State");
		objXAD.setZipOrPostalCode("456789");
		objXAD.setCountry("IND");
		objXAD.setAddressType("BA");
		objXAD.setOtherGeographicDesignation("OD");
		objXAD.setCountyParishCode("1N");
		objXAD.setCensusTract("1289");
		objXAD.setAddressRepresentationCode("I");
		objXAD.setEffectiveDate(objEffectiveDate);
		objXAD.setExpirationDate(objExpirationDate);
		objXAD.setAddressee("ADDS");
		objXAD.setAddressIdentifier(objEI);
		objXAD.setAddressUsage("ADDU");
		objXAD.setBadAddressIndicator("BADDI");
		objXAD.setComment("CMT");
		objXAD.setCountyParishCode("INDPC");
		objXAD.setExpirationReason(objCWE);
		objXAD.setPreferenceOrder("PRFO");
		objXAD.setProtectionCode(objCWE);
		objXAD.setTemporaryIndicator("TEMPI");
		
		CX objCX = new CX();
		objCX.setIdNumber("1");
		objCX.setCheckDigit("8");
		objCX.setCheckDigitScheme("NPI");
		objCX.setAssigningAuthority(objHD);
		objCX.setIdentifierTypeCode("AN");
		objCX.setAssigningFacility(objHD);
		objCX.setEffectiveDate("20040304");
		objCX.setExpirationDate("20040305");
		objCX.setAssigningJurisdiction(objCWE);
		objCX.setAssigningAgencyOrDepartment(objCWE);
		objCX.setSecurityCheck("strSecurityCheck");
		objCX.setSecurityCheckScheme("strSecurityCheckScheme");
		
		XTN objXTN = new XTN();
		objXTN.setLocalNumber("Telephone Number");
		objXTN.setTelecommunicationUseCode("ORN");
		objXTN.setTelecommunicationEquipmentType("Internet");
		objXTN.setCountryCode("546");
		objXTN.setAreaCityCode("54321");
		objXTN.setLocalNumber("123456789");
		objXTN.setExtension("67890");
		objXTN.setAnyText("Any Text");
		objXTN.setExtensionPrefix("EP");
		objXTN.setSpeedDialCode("SDC");
		objXTN.setUnformattedTelephonenumber("1-800-Dentist");
		
		XPN objXPN = new XPN();
		objXPN.setFamilyName(objFN);
		objXPN.setGivenName("anurag");
		objXPN.setSecondNameOrInitials("kulk");
		objXPN.setSuffix("w");
		objXPN.setPrefix("p");
		objXPN.setNameTypeCode("A");
		objXPN.setNameRepresentationCode("I");
		objXPN.setNameContext(objCWE);
		objXPN.setNameAssemblyOrder("G");
		objXPN.setEffectiveDate("20040304");
		objXPN.setExpirationDate("20040304");
		objXPN.setProfessionalSuffix("TXT");
		objXPN.setCalledBy("strCalledBy");
		
		MO objPrice = new MO();
		objPrice.setQuantity("99");
		objPrice.setDenomination("USD");
		
		PL objPL = new PL();
		objPL.setPointOfCare(objHD);
		objPL.setRoom(objHD);
		objPL.setBed(objHD);
		objPL.setFacility(objHD);
		objPL.setLocationStatus("AB");
		objPL.setPersonLocationType("C");
		objPL.setBuilding("H");
		objPL.setFloor("AB");
		objPL.setLocationDescription("AB");
		objPL.setComprehensiveLocationIdentifier(objEI);
		objPL.setAssigningAuthorityForLocation(objHD);


		//PD1 Segment
		PD1 objPD1 = new PD1();
		objPD1.addLivingDependency(objCWE);//IS
		objPD1.setLivingArrangement(objCWE);//IS
		objPD1.addPatientPrimaryFacility("strOrganizationName", "strOrganizationNameTypeCode", objHD, "strIdentifierTypeCode", objHD, "strNameRepresentationCode", "strOrganizationIdentifier");
		
		objPD1.setStudentIndicator(objCWE);//IS
		objPD1.setHandicap(objCWE);//IS
		objPD1.setLivingWillCode(objCWE);//IS
		objPD1.setOrganDonorCode(objCWE);//IS
		objPD1.setSeparateBill("Y");//ID
		objPD1.addDuplicatePatient(objCX);
		objPD1.setPublicityCode(objCWE);//CE
		objPD1.setProtectionIndicator("Y");//ID
		objPD1.setProtectionIEDate("19850212");//DT
		objPD1.addPlaceOfWorship("strOrganizationName", objCWE, objHD, "strIdentifierTypeCode", objHD, "strNameRepresentationCode", "strOrganizationIdentifier");
		objPD1.addAdvanceDirectiveCode(objCWE);//CE
		objPD1.setImmunizationRegistryStatus(objCWE);//IS
		objPD1.setImmunizationRSEffectiveDate("19850212");//DT
		objPD1.setPublicityCodeEffectiveDate("19850212");//DT
		objPD1.setMilitaryBranch(objCWE);//IS
		objPD1.setMilitaryRank_Grade(objCWE);//IS
		objPD1.setMilitaryStatus(objCWE);//IS
		objPD1.setAdvanceDirectiveLastVerifiedDate("strAdvanceDirectiveLastVerifiedDate");
		return objPD1;
	}
	
	/**
	 * populates NTE Segment
	 * @return NTE
	 */
	private NTE populateNTE()
	{
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");
		
		FN objFN = new FN();
		objFN.setSurname("AB");
		objFN.setOwnSurnamePrefix("AB");
		objFN.setOwnSurname("AB");
		objFN.setSurnamePrefixFromPartnerSpouse("AB");
		objFN.setSurnameFromPartnerSpouse("AB");
		
		HD objHD = new HD();
		objHD.setNamespaceId("REGAD1");
		objHD.setUniversalId("UI2");
		objHD.setUniversalIdType("GUID");
	
		XCN objXCN = new XCN();
		objXCN.setIdNumber("1");
		objXCN.setFamilyName(objFN);
		objXCN.setGivenName("Anurag");
		objXCN.setSecondNameOrInitials("Anu");
		objXCN.setSuffix("A");
		objXCN.setPrefix("K");
		objXCN.setSourceTable("297");
		objXCN.setAssigningAuthority(objHD);
		objXCN.setNameTypeCode("A");
		objXCN.setIdentifierCheckDigit("7");
		objXCN.setCheckDigitScheme("NPI");
		objXCN.setIdentifierTypeCode("AM");
		objXCN.setAssigningFacility(objHD);
		objXCN.setNameRepresentationCode("I");
		objXCN.setNameContext(objCWE);
		objXCN.setNameAssemblyOrder("F");
		objXCN.setEffectiveDate("20030303");
		objXCN.setExpirationDate("20030303");
		objXCN.setProfessionalSuffix("PS");
		objXCN.setAssigningJurisdiction(objCWE);
		objXCN.setAssigningAgencyOrDepartment(objCWE);
		objXCN.setSecurityCheck("strSecurityCheck");
		objXCN.setSecurityCheckScheme("strSecurityCheckScheme");
		
		//NTE segment
		NTE objNTE = new NTE();
		objNTE.setSetID_NTE("2");
		objNTE.setSourceOfComment("L");
		objNTE.addComment("comment");
		objNTE.setCommentType(objCWE);
		objNTE.setEnteredBy(objXCN);
		return objNTE;
	}

	/**
	 * populates NK1 Segment
	 * @return NK1
	 */
	public  NK1 populateNK1()
	{

		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");
		
		FN objFN = new FN();
		objFN.setSurname("AB");
		objFN.setOwnSurnamePrefix("AB");
		objFN.setOwnSurname("AB");
		objFN.setSurnamePrefixFromPartnerSpouse("AB");
		objFN.setSurnameFromPartnerSpouse("AB");
		
		HD objHD = new HD();
		objHD.setNamespaceId("REGAD1");
		objHD.setUniversalId("UI2");
		objHD.setUniversalIdType("GUID");
	
		XCN objXCN = new XCN();
		objXCN.setIdNumber("1");
		objXCN.setFamilyName(objFN);
		objXCN.setGivenName("Anurag");
		objXCN.setSecondNameOrInitials("Anu");
		objXCN.setSuffix("A");
		objXCN.setPrefix("K");
		objXCN.setSourceTable("297");
		objXCN.setAssigningAuthority(objHD);
		objXCN.setNameTypeCode("A");
		objXCN.setIdentifierCheckDigit("7");
		objXCN.setCheckDigitScheme("NPI");
		objXCN.setIdentifierTypeCode("AM");
		objXCN.setAssigningFacility(objHD);
		objXCN.setNameRepresentationCode("I");
		objXCN.setNameContext(objCWE);
		objXCN.setNameAssemblyOrder("F");
		objXCN.setEffectiveDate("20030303");
		objXCN.setExpirationDate("20030303");
		objXCN.setProfessionalSuffix("PS");
		objXCN.setAssigningJurisdiction(objCWE);
		objXCN.setAssigningAgencyOrDepartment(objCWE);
		objXCN.setSecurityCheck("strSecurityCheck");
		objXCN.setSecurityCheckScheme("strSecurityCheckScheme");
		
		SAD objSAD = new SAD();
		objSAD.setStreetOrMailingAddress("AB");
		objSAD.setStreetName("AB");
		objSAD.setDwellingNumber("AB");
		
		EI objEI = new EI();
		objEI.setEntityIdentifier("AB");
		objEI.setNamespaceId("AB");
		objEI.setUniversalId("AB");
		objEI.setUniversalIdType("DNS");
		
		XAD objXAD = new XAD();
		objXAD.setStreetAddress(objSAD);
		objXAD.setOtherDesignation("OD");
		objXAD.setCity("CTY");
		objXAD.setStateOrProvince("State");
		objXAD.setZipOrPostalCode("456789");
		objXAD.setCountry("IND");
		objXAD.setAddressType("BA");
		objXAD.setOtherGeographicDesignation("OD");
		objXAD.setCountyParishCode("1N");
		objXAD.setCensusTract("1289");
		objXAD.setAddressRepresentationCode("I");
		objXAD.setEffectiveDate(objEffectiveDate);
		objXAD.setExpirationDate(objExpirationDate);
		objXAD.setAddressee("ADDS");
		objXAD.setAddressIdentifier(objEI);
		objXAD.setAddressUsage("ADDU");
		objXAD.setBadAddressIndicator("BADDI");
		objXAD.setComment("CMT");
		objXAD.setCountyParishCode("INDPC");
		objXAD.setExpirationReason(objCWE);
		objXAD.setPreferenceOrder("PRFO");
		objXAD.setProtectionCode(objCWE);
		objXAD.setTemporaryIndicator("TEMPI");
		
		CX objCX = new CX();
		objCX.setIdNumber("1");
		objCX.setCheckDigit("8");
		objCX.setCheckDigitScheme("NPI");
		objCX.setAssigningAuthority(objHD);
		objCX.setIdentifierTypeCode("AN");
		objCX.setAssigningFacility(objHD);
		objCX.setEffectiveDate("20040304");
		objCX.setExpirationDate("20040305");
		objCX.setAssigningJurisdiction(objCWE);
		objCX.setAssigningAgencyOrDepartment(objCWE);
		objCX.setSecurityCheck("strSecurityCheck");
		objCX.setSecurityCheckScheme("strSecurityCheckScheme");
		
		XTN objXTN = new XTN();
		objXTN.setLocalNumber("Telephone Number");
		objXTN.setTelecommunicationUseCode("ORN");
		objXTN.setTelecommunicationEquipmentType("Internet");
		objXTN.setCountryCode("546");
		objXTN.setAreaCityCode("54321");
		objXTN.setLocalNumber("123456789");
		objXTN.setExtension("67890");
		objXTN.setAnyText("Any Text");
		objXTN.setExtensionPrefix("EP");
		objXTN.setSpeedDialCode("SDC");
		objXTN.setUnformattedTelephonenumber("1-800-Dentist");
		
		XPN objXPN = new XPN();
		objXPN.setFamilyName(objFN);
		objXPN.setGivenName("anurag");
		objXPN.setSecondNameOrInitials("kulk");
		objXPN.setSuffix("w");
		objXPN.setPrefix("p");
		objXPN.setNameTypeCode("A");
		objXPN.setNameRepresentationCode("I");
		objXPN.setNameContext(objCWE);
		objXPN.setNameAssemblyOrder("G");
		objXPN.setEffectiveDate("20040304");
		objXPN.setExpirationDate("20040304");
		objXPN.setProfessionalSuffix("TXT");
		objXPN.setCalledBy("strCalledBy");
		
		MO objPrice = new MO();
		objPrice.setQuantity("99");
		objPrice.setDenomination("USD");

	
		//NK1 segment
		NK1 objNK1 = new NK1();
		objNK1.setSetIDNK1("8");
		objNK1.addName(objXPN);
		objNK1.setRelationship(objCWE);
		objNK1.addAddress(objXAD);
		objNK1.addPhoneNumber(objXTN);
		objNK1.addBusinessPhoneNumber(objXTN);
		objNK1.setContactRole(objCWE);
		objNK1.setStartDate("20060304");
		objNK1.setEndDate("20060304");
		objNK1.setNextOfKinAssociatedPartiesJobTitle("PartiesJobTitle");
		objNK1.setNextOfKinAssociatedPartiesJobCodeClass(objCWE, objCWE, "strJobDescriptionText");//JCC
		objNK1.setNextOfKinAssociatedPartiesEmployeeNumber(objCX);
		objNK1.addOrganizationNameNK1("strOrganizationName", objCWE, objHD, "strIdentifierTypeCode", objHD, "strNameRepresentationCode", "strOrganizationIdentifier");
		objNK1.setMaritalStatus(objCWE);
		objNK1.setAdministrativeSex(objCWE);
		objNK1.addLivingDependency(objCWE);
		objNK1.addAmbulatoryStatus(objCWE);
		objNK1.addCitizenship(objCWE);
		objNK1.setPrimaryLanguage(objCWE);
		objNK1.setLivingArrangement(objCWE);
		objNK1.setPublicityCode(objCWE);
		objNK1.setProtectionIndicator("N");
		objNK1.setStudentIndicator(objCWE);
		objNK1.setReligion(objCWE);
		objNK1.addMothersMaidenName(objXPN);
		objNK1.setNationality(objCWE);
		objNK1.addEthnicGroup(objCWE);
		objNK1.addContactReason(objCWE);
		objNK1.addContactPersonsName(objXPN);
		objNK1.addContactPersonsTelephoneNumber(objXTN);
		objNK1.addContactPersonsAddress(objXAD);
		objNK1.addNextOfKinAssociatedPartysIdentifiers(objCX);
		objNK1.setJobStatus(objCWE);
		objNK1.addRace(objCWE);
		objNK1.setHandicap(objCWE);
		objNK1.setContactPersonSocialSecurityNumber("CPSN");
		objNK1.setNextOfKinBirthPlace("NextOfKinBirthPlace");
		objNK1.setVIPIndicator(objCWE);
		objNK1.setNextOfKinTelecommunicationInformation(objXTN);
		objNK1.setContactPersonsTelecommunicationInformation(objXTN);
		return objNK1;
	}
	
	/**
	 * Populate ARV Segment
	 * @return ARV
	 */
	public ARV populateARV()
	{
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");
		
		CNE objCNE = new CNE();
		objCNE.setIdentifier("I");
		objCNE.setText("T");
		objCNE.setNameOfCodingSystem("Coding");
		objCNE.setAlternateIdentifier("A");
		objCNE.setAlternateText("T");
		objCNE.setNameOfAlternateCodingSystem("System");
		objCNE.setCodingSystemVersionID("V");
		objCNE.setAlternateCodingSystemVersionID("S");
		objCNE.setOriginalText("O");
		objCNE.setSecondAlternateIdentifier("strSecondAlternateIdentifier");
		objCNE.setSecondAlternateText("strSecondAlternateText");
		objCNE.setNameofSecondAlternateCodingSystem("strNameofSecondAlternateCodingSystem");
		objCNE.setSecondAlternateCodingSystemVersionID("strSecondAlternateCodingSystemVersionID");
		objCNE.setCodingSystemOID("strCodingSystemOID");
		objCNE.setValueSetOID("strValueSetOID");
		objCNE.setValueSetVersionID("strValueSetVersionID");
		objCNE.setAlternateCodingSystemOID("strAlternateCodingSystemOID");
		objCNE.setAlternateValueSetOID("strAlternateValueSetOID");
		objCNE.setAlternateValueSetVersionID("strAlternateValueSetVersionID");
		objCNE.setSecondAlternateCodingSystemOID("strSecondAlternateCodingSystemOID");
		objCNE.setSecondAlternateValueSetOID("strSecondAlternateValueSetOID");
		objCNE.setSecondAlternateValueSetVersionID("AVSID");
		
		ARV objARV=new ARV();
		objARV.setAccessRestrictionActionCode(objCNE);
		objARV.setAccessRestrictionDateRange(objEffectiveDate, objExpirationDate);
		objARV.setSetID("1");
		objARV.addSpecialAccessRestrictionInstructions("ACCRI");
		objARV.addAccessRestrictionReason(objCWE);
		objARV.setAccessRestrictionValue(objCWE);
		return objARV;
	}
	
	/**
	 * Populate PRT Segment
	 * @return PRT
	 */
	public PRT populatePRT()
	{
		HD objHD = new HD();
		objHD.setNamespaceId("NID");
		objHD.setUniversalId("Universal Id");
		objHD.setUniversalIdType("x400");
		
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");

		CNE objCNE = new CNE();
		objCNE.setIdentifier("I");
		objCNE.setText("T");
		objCNE.setNameOfCodingSystem("Coding");
		objCNE.setAlternateIdentifier("A");
		objCNE.setAlternateText("T");
		objCNE.setNameOfAlternateCodingSystem("System");
		objCNE.setCodingSystemVersionID("V");
		objCNE.setAlternateCodingSystemVersionID("S");
		objCNE.setOriginalText("O");
		objCNE.setSecondAlternateIdentifier("strSecondAlternateIdentifier");
		objCNE.setSecondAlternateText("strSecondAlternateText");
		objCNE.setNameofSecondAlternateCodingSystem("strNameofSecondAlternateCodingSystem");
		objCNE.setSecondAlternateCodingSystemVersionID("strSecondAlternateCodingSystemVersionID");
		objCNE.setCodingSystemOID("strCodingSystemOID");
		objCNE.setValueSetOID("strValueSetOID");
		objCNE.setValueSetVersionID("strValueSetVersionID");
		objCNE.setAlternateCodingSystemOID("strAlternateCodingSystemOID");
		objCNE.setAlternateValueSetOID("strAlternateValueSetOID");
		objCNE.setAlternateValueSetVersionID("strAlternateValueSetVersionID");
		objCNE.setSecondAlternateCodingSystemOID("strSecondAlternateCodingSystemOID");
		objCNE.setSecondAlternateValueSetOID("strSecondAlternateValueSetOID");
		objCNE.setSecondAlternateValueSetVersionID("AVSID");
		
		FN objFN = new FN();
		objFN.setSurname("AB");
		objFN.setOwnSurnamePrefix("AB");
		objFN.setOwnSurname("AB");
		objFN.setSurnamePrefixFromPartnerSpouse("AB");
		objFN.setSurnameFromPartnerSpouse("AB");
		
		XCN objXCN = new XCN();
		objXCN.setIdNumber("1");
		objXCN.setFamilyName(objFN);
		objXCN.setGivenName("Anurag");
		objXCN.setSecondNameOrInitials("Anu");
		objXCN.setSuffix("A");
		objXCN.setPrefix("K");
		objXCN.setSourceTable("297");
		objXCN.setAssigningAuthority(objHD);
		objXCN.setNameTypeCode("A");
		objXCN.setIdentifierCheckDigit("7");
		objXCN.setCheckDigitScheme("NPI");
		objXCN.setIdentifierTypeCode("AM");
		objXCN.setAssigningFacility(objHD);
		objXCN.setNameRepresentationCode("I");
		objXCN.setNameContext(objCWE);
		objXCN.setNameAssemblyOrder("F");
		objXCN.setEffectiveDate("20030303");
		objXCN.setExpirationDate("20030303");
		objXCN.setProfessionalSuffix("PS");
		objXCN.setAssigningJurisdiction(objCWE);
		objXCN.setAssigningAgencyOrDepartment(objCWE);
		objXCN.setSecurityCheck("strSecurityCheck");
		objXCN.setSecurityCheckScheme("strSecurityCheckScheme");
		
		CX objCX = new CX();
		objCX.setIdNumber("1");
		objCX.setCheckDigit("8");
		objCX.setCheckDigitScheme("NPI");
		objCX.setAssigningAuthority(objHD);
		objCX.setIdentifierTypeCode("AN");
		objCX.setAssigningFacility(objHD);
		objCX.setEffectiveDate("20040304");
		objCX.setExpirationDate("20040305");
		objCX.setAssigningJurisdiction(objCWE);
		objCX.setAssigningAgencyOrDepartment(objCWE);
		objCX.setSecurityCheck("strSecurityCheck");
		objCX.setSecurityCheckScheme("strSecurityCheckScheme");
		
		EI objEI = new EI();
		objEI.setEntityIdentifier("AB");
		objEI.setNamespaceId("AB");
		objEI.setUniversalId("AB");
		objEI.setUniversalIdType("DNS");
		
		PL objPL = new PL();
		objPL.setPointOfCare(objHD);
		objPL.setRoom(objHD);
		objPL.setBed(objHD);
		objPL.setFacility(objHD);
		objPL.setLocationStatus("AB");
		objPL.setPersonLocationType("C");
		objPL.setBuilding("H");
		objPL.setFloor("AB");
		objPL.setLocationDescription("AB");
		objPL.setComprehensiveLocationIdentifier(objEI);
		objPL.setAssigningAuthorityForLocation(objHD);
		SAD objSAD = new SAD();
		objSAD.setStreetOrMailingAddress("AB");
		objSAD.setStreetName("AB");
		objSAD.setDwellingNumber("AB");
	
		XAD objXAD = new XAD();
		objXAD.setStreetAddress(objSAD);
		objXAD.setOtherDesignation("OD");
		objXAD.setCity("CTY");
		objXAD.setStateOrProvince("State");
		objXAD.setZipOrPostalCode("456789");
		objXAD.setCountry("IND");
		objXAD.setAddressType("BA");
		objXAD.setOtherGeographicDesignation("OD");
		objXAD.setCountyParishCode("1N");
		objXAD.setCensusTract("1289");
		objXAD.setAddressRepresentationCode("I");
		objXAD.setEffectiveDate(objEffectiveDate);
		objXAD.setExpirationDate(objExpirationDate);
		objXAD.setAddressee("ADDS");
		objXAD.setAddressIdentifier(objEI);
		objXAD.setAddressUsage("ADDU");
		objXAD.setBadAddressIndicator("BADDI");
		objXAD.setComment("CMT");
		objXAD.setCountyParishCode("INDPC");
		objXAD.setExpirationReason(objCWE);
		objXAD.setPreferenceOrder("PRFO");
		objXAD.setProtectionCode(objCWE);
		objXAD.setTemporaryIndicator("TEMPI");
		
		XTN objXTN = new XTN();
		objXTN.setLocalNumber("Telephone Number");
		objXTN.setTelecommunicationUseCode("ORN");
		objXTN.setTelecommunicationEquipmentType("Internet");
		objXTN.setCountryCode("546");
		objXTN.setAreaCityCode("54321");
		objXTN.setLocalNumber("123456789");
		objXTN.setExtension("67890");
		objXTN.setAnyText("Any Text");
		objXTN.setExtensionPrefix("EP");
		objXTN.setSpeedDialCode("SDC");
		objXTN.setUnformattedTelephonenumber("1-800-Dentist");
		
		PRT objPRT=new PRT();
		objPRT.setParticipationInstanceID(objEI);
		objPRT.setActionCode("strActioncode");
		objPRT.setActionReason(objCWE);
		objPRT.setParticipation(objCWE);
		objPRT.addParticipationPerson(objXCN);
		objPRT.setParticipationPersonProviderType(objCWE);
		objPRT.setParticipationOrganizationUnitType(objCWE);
		objPRT.addParticipationOrganization("strOrganizationName", objCWE, objHD, "strIdentifierTypeCode", objHD, "strNameRepresentationCode", "strOrganizationIdentifier");
		objPRT.addParticipationLocation(objPL);
		objPRT.addParticipationDevice(objEI);
		objPRT.setParticipationBeginDateTime("strTime");
		objPRT.setParticipationEndDateTime("strTime");
		objPRT.setParticipationQualitativeDuration(objCWE);
		objPRT.addParticipationAddress(objXAD);
		objPRT.addParticipantTelecommunicationAddress(objXTN);
		objPRT.setParticipantDeviceIdentifier(objEI);
		objPRT.setParticipationDeviceManufactureDate("strTime");
		objPRT.setParticipationDeviceExpiryDate("strTime");
		objPRT.setParticipationDeviceLotNumber("strParticipationDeviceLotNumber");
		objPRT.setParticipationDeviceSerialNumber("strparticipationDeviceSerialNumber");
		objPRT.setParticipationDeviceDonationIdentification(objEI);
		objPRT.setParticipationDeviceType(objCNE);
		return objPRT;
	}

	/**
	 * populates PV1 Segment
	 * @return PV1
	 */
	public  PV1 populatePV1()
	{
		HD objHD = new HD();
		objHD.setNamespaceId("NID");
		objHD.setUniversalId("Universal Id");
		objHD.setUniversalIdType("x400");
		EI objComprehensiveLocationIdentifier = new EI();
		objComprehensiveLocationIdentifier.setEntityIdentifier("Entity Identifier");
		objComprehensiveLocationIdentifier.setNamespaceId("NAMESPACE");
		objComprehensiveLocationIdentifier.setUniversalId("UniversalId");
		objComprehensiveLocationIdentifier.setUniversalIdType("x500");
		
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");
		
		
		
		FN objFN = new FN();
		objFN.setSurname("AB");
		objFN.setOwnSurnamePrefix("AB");
		objFN.setOwnSurname("AB");
		objFN.setSurnamePrefixFromPartnerSpouse("AB");
		objFN.setSurnameFromPartnerSpouse("AB");
		
		XCN objXCN = new XCN();
		objXCN.setIdNumber("1");
		objXCN.setFamilyName(objFN);
		objXCN.setGivenName("Anurag");
		objXCN.setSecondNameOrInitials("Anu");
		objXCN.setSuffix("A");
		objXCN.setPrefix("K");
		objXCN.setSourceTable("297");
		objXCN.setAssigningAuthority(objHD);
		objXCN.setNameTypeCode("A");
		objXCN.setIdentifierCheckDigit("7");
		objXCN.setCheckDigitScheme("NPI");
		objXCN.setIdentifierTypeCode("AM");
		objXCN.setAssigningFacility(objHD);
		objXCN.setNameRepresentationCode("I");
		objXCN.setNameContext(objCWE);
		objXCN.setNameAssemblyOrder("F");
		objXCN.setEffectiveDate("20030303");
		objXCN.setExpirationDate("20030303");
		objXCN.setProfessionalSuffix("PS");
		objXCN.setAssigningJurisdiction(objCWE);
		objXCN.setAssigningAgencyOrDepartment(objCWE);
		objXCN.setSecurityCheck("strSecurityCheck");
		objXCN.setSecurityCheckScheme("strSecurityCheckScheme");
		
		CX objCX = new CX();
		objCX.setIdNumber("1");
		objCX.setCheckDigit("8");
		objCX.setCheckDigitScheme("NPI");
		objCX.setAssigningAuthority(objHD);
		objCX.setIdentifierTypeCode("AN");
		objCX.setAssigningFacility(objHD);
		objCX.setEffectiveDate("20040304");
		objCX.setExpirationDate("20040305");
		objCX.setAssigningJurisdiction(objCWE);
		objCX.setAssigningAgencyOrDepartment(objCWE);
		objCX.setSecurityCheck("strSecurityCheck");
		objCX.setSecurityCheckScheme("strSecurityCheckScheme");
		
		PL objPL = new PL();
		objPL.setPointOfCare(objHD);
		objPL.setRoom(objHD);
		objPL.setBed(objHD);
		objPL.setFacility(objHD);
		objPL.setLocationStatus("AB");
		objPL.setPersonLocationType("C");
		objPL.setBuilding("H");
		objPL.setFloor("AB");
		objPL.setLocationDescription("AB");
		objPL.setComprehensiveLocationIdentifier(objComprehensiveLocationIdentifier);
		objPL.setAssigningAuthorityForLocation(objHD);
		
		//PV1 segment
		PV1 objPV1 = new PV1();
		objPV1.setSetID("3");
		objPV1.setPatientClass(objCWE);	objPV1.setAssignedPatientLocation(objPL);
		objPV1.setAdmissionType(objCWE);
		objPV1.setPreAdmitNumber(objCX);
		objPV1.setPriorPatientLocation(objPL);
		objPV1.addAttendingDoctor(objXCN);
		objPV1.addReferringDoctor(objXCN);
		objPV1.addConsultingDoctor(objXCN);
		objPV1.setHospitalService(objCWE);
		objPV1.setTemporaryLocation(objPL);
		objPV1.setPreAdmitTestIndicator(objCWE);
		objPV1.setReAdmissionIndicator(objCWE);
		objPV1.setAdmitSource(objCWE);
		objPV1.addAmbulatoryStatus(objCWE);
		objPV1.setVipIndicator(objCWE);
		objPV1.addAdmittingDoctor(objXCN);
		objPV1.setPatientType(objCWE);
		objPV1.setVisitNumber(objCX);
		objPV1.addFinancialClass("Financial", objEffectiveDate);
		objPV1.setChargePriceIndicator(objCWE);
		objPV1.setCourtesyCode(objCWE);
		objPV1.setCreditRating(objCWE);
		objPV1.addContractCode(objCWE);
		objPV1.addContractEffectiveDate("20040807");
		objPV1.addContractAmount("1234567890");
		objPV1.addContractPeriod("100");
		objPV1.setInterestCode(objCWE);
		objPV1.setTransferToBadDebtCode(objCWE);
		objPV1.setTransferToBadDebtDate("20020303");
		objPV1.setBadDebtAgencyCode(objCWE);
		objPV1.setBadDebtTransferAmount("1234567890");
		objPV1.setBadDebtRecoveryAmount("1234567890");
		objPV1.setDeleteAccountIndicator(objCWE);
		objPV1.setDeleteAccountDate("20020202");
		objPV1.setDischargeDisposition(objCWE);
		objPV1.setDischargedToLocation("DISCH_LOC", objEffectiveDate);//DLD
		objPV1.setDietType(objCWE);
		objPV1.setServicingFacility(objCWE);
		objPV1.setAccountStatus(objCWE);
		objPV1.setPendingLocation(objPL);
		objPV1.setPriorTemporaryLocation(objPL);
		objPV1.setCurrentPatientBalance("123456789");
		objPV1.setTotalCharges("123456789");
		objPV1.setTotalAdjustments("12345678");
		objPV1.setTotalPayments("123456789");
		objPV1.setAlternateVisitID(objCX);
		objPV1.setVisitIndicator(objCWE);
		objPV1.setServiceEpisodeDescription("strServiceEpisodeDescription");
		objPV1.setServiceEpisodeIdentifier(objCX);
		
		return objPV1;
	}

	/**
	 * populates PV2 Segment
	 * @return PV2
	 */
	public  PV2 populatePV2()
	{
		HD objHD = new HD();
		objHD.setNamespaceId("NID");
		objHD.setUniversalId("Universal Id");
		objHD.setUniversalIdType("x400");
		EI objComprehensiveLocationIdentifier = new EI();
		objComprehensiveLocationIdentifier.setEntityIdentifier("Entity Identifier");
		objComprehensiveLocationIdentifier.setNamespaceId("NAMESPACE");
		objComprehensiveLocationIdentifier.setUniversalId("UniversalId");
		objComprehensiveLocationIdentifier.setUniversalIdType("x500");
		//PV2 segment
		
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");
		
		
		
		FN objFN = new FN();
		objFN.setSurname("AB");
		objFN.setOwnSurnamePrefix("AB");
		objFN.setOwnSurname("AB");
		objFN.setSurnamePrefixFromPartnerSpouse("AB");
		objFN.setSurnameFromPartnerSpouse("AB");
		
		XCN objXCN = new XCN();
		objXCN.setIdNumber("1");
		objXCN.setFamilyName(objFN);
		objXCN.setGivenName("Anurag");
		objXCN.setSecondNameOrInitials("Anu");
		objXCN.setSuffix("A");
		objXCN.setPrefix("K");
		objXCN.setSourceTable("297");
		objXCN.setAssigningAuthority(objHD);
		objXCN.setNameTypeCode("A");
		objXCN.setIdentifierCheckDigit("7");
		objXCN.setCheckDigitScheme("NPI");
		objXCN.setIdentifierTypeCode("AM");
		objXCN.setAssigningFacility(objHD);
		objXCN.setNameRepresentationCode("I");
		objXCN.setNameContext(objCWE);
		objXCN.setNameAssemblyOrder("F");
		objXCN.setEffectiveDate("20030303");
		objXCN.setExpirationDate("20030303");
		objXCN.setProfessionalSuffix("PS");
		objXCN.setAssigningJurisdiction(objCWE);
		objXCN.setAssigningAgencyOrDepartment(objCWE);
		objXCN.setSecurityCheck("strSecurityCheck");
		objXCN.setSecurityCheckScheme("strSecurityCheckScheme");
		
		
		PV2 objPV2 = new PV2();
		objPV2.setPriorPendingLocation(objHD, objHD, objHD, objHD, "strLocationStatus", "strPersonLocationType", objHD, objHD, "strLocationDescription", objComprehensiveLocationIdentifier, objAssigningAuthority);
		objPV2.setAccomodationCode(objCWE);
		objPV2.setAdmitReason(objCWE);
		objPV2.setTransferReason(objCWE);
		objPV2.addPatientValuables("PatientValuables");
		objPV2.setPatientValusblesLocation("strPatientValuab");
		objPV2.addVisitUserCode(objCWE);
		objPV2.setEstimatedLengthOfInPatientStay("123");
		objPV2.setActualLengthOfInPatientStay("456");
		objPV2.setVisitDescription("VisitDescription");
		objPV2.addReferralSourceCode(objXCN);
		objPV2.setEmploymentIllnessRelatedIndicator("Y");
		objPV2.setPurgeStatusCode(objCWE);
		objPV2.setSpecialProgramCode("CH");
		objPV2.setRetentionIndicator("N");
		objPV2.setExpectedNumberOfInsurancePlans("8");
		objPV2.setVisitPublicityCode(objCWE);
		objPV2.setVisitProtectionIndicator("Y");
		
		objPV2.addClinicOrganizationName("strOrganizationName", objCWE, objHD, "strIdentifierTypeCode", objHD, "strNameRepresentationCode", "strOrganizationIdentifier");
		objPV2.setPatientStatusCode(objCWE);
		objPV2.setVisitPriorityCode(objCWE);
		objPV2.setExpectedDischargeDisposition(objCWE);
		objPV2.setPatientChargeAdjustmentCode(objCWE);
		objPV2.setRecurringServiceCode(objCWE);
		objPV2.setBillingmediaCode("N");
		objPV2.setMilitaryPartnershipCode("Y");
		objPV2.setMilitaryNonAvailabilityCode("Y");
		objPV2.setNewBornBabyIndictor("Y");
		objPV2.setBabyDetainedIndicator("Y");
		objPV2.setModeOfArrivalCode(objCWE);
		objPV2.addRecreationalDrugUseCode(objCWE);
		objPV2.setAdmissionLevelOfCareCode(objCWE);
		objPV2.addPrecautionCode(objCWE);
		objPV2.setPatientConditionCode(objCWE);
		objPV2.setLivingWillCode(objCWE);
		objPV2.setOrganDonorCode(objCWE);
		objPV2.addAdvanceDirectiveCode( objCWE);
		objPV2.addNotifyClergyCode(objCWE);
		objPV2.setAdvanceDirectiveLastVerifiedDate("strAdvanceDirectiveLastVerifiedDate");
		return objPV2;
	}


	/**
	 * populates ORC Segment
	 * @return ORC
	 */
	private ORC populateORC()
	{
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");

		
		EI objEI = new EI();
		objEI.setEntityIdentifier("AB");
		objEI.setNamespaceId("AB");
		objEI.setUniversalId("AB");
		objEI.setUniversalIdType("DNS");
		
		HD objHD = new HD();
		objHD.setNamespaceId("REGAD1");
		objHD.setUniversalId("UI2");
		objHD.setUniversalIdType("GUID");

		XTN objXTN = new XTN();
		objXTN.setLocalNumber("Telephone Number");
		objXTN.setTelecommunicationUseCode("ORN");
		objXTN.setTelecommunicationEquipmentType("Internet");
		objXTN.setCountryCode("546");
		objXTN.setAreaCityCode("54321");
		objXTN.setLocalNumber("123456789");
		objXTN.setExtension("67890");
		objXTN.setAnyText("Any Text");
		objXTN.setExtensionPrefix("EP");
		objXTN.setSpeedDialCode("SDC");
		objXTN.setUnformattedTelephonenumber("1-800-Dentist");
		
		CNE objCNE = new CNE();
		objCNE.setIdentifier("I");
		objCNE.setText("T");
		objCNE.setNameOfCodingSystem("Coding");
		objCNE.setAlternateIdentifier("A");
		objCNE.setAlternateText("T");
		objCNE.setNameOfAlternateCodingSystem("System");
		objCNE.setCodingSystemVersionID("V");
		objCNE.setAlternateCodingSystemVersionID("S");
		objCNE.setOriginalText("O");
		objCNE.setSecondAlternateIdentifier("strSecondAlternateIdentifier");
		objCNE.setSecondAlternateText("strSecondAlternateText");
		objCNE.setNameofSecondAlternateCodingSystem("strNameofSecondAlternateCodingSystem");
		objCNE.setSecondAlternateCodingSystemVersionID("strSecondAlternateCodingSystemVersionID");
		objCNE.setCodingSystemOID("strCodingSystemOID");
		objCNE.setValueSetOID("strValueSetOID");
		objCNE.setValueSetVersionID("strValueSetVersionID");
		objCNE.setAlternateCodingSystemOID("strAlternateCodingSystemOID");
		objCNE.setAlternateValueSetOID("strAlternateValueSetOID");
		objCNE.setAlternateValueSetVersionID("strAlternateValueSetVersionID");
		objCNE.setSecondAlternateCodingSystemOID("strSecondAlternateCodingSystemOID");
		objCNE.setSecondAlternateValueSetOID("strSecondAlternateValueSetOID");
		objCNE.setSecondAlternateValueSetVersionID("AVSID");
		FN objFN = new FN();
		objFN.setSurname("AB");
		objFN.setOwnSurnamePrefix("AB");
		objFN.setOwnSurname("AB");
		objFN.setSurnamePrefixFromPartnerSpouse("AB");
		objFN.setSurnameFromPartnerSpouse("AB");
	
		XCN objXCN = new XCN();
		objXCN.setIdNumber("1");
		objXCN.setFamilyName(objFN);
		objXCN.setGivenName("Anurag");
		objXCN.setSecondNameOrInitials("Anu");
		objXCN.setSuffix("A");
		objXCN.setPrefix("K");
		objXCN.setSourceTable("297");
		objXCN.setAssigningAuthority(objHD);
		objXCN.setNameTypeCode("A");
		objXCN.setIdentifierCheckDigit("7");
		objXCN.setCheckDigitScheme("NPI");
		objXCN.setIdentifierTypeCode("AM");
		objXCN.setAssigningFacility(objHD);
		objXCN.setNameRepresentationCode("I");
		objXCN.setNameContext(objCWE);
		objXCN.setNameAssemblyOrder("F");
		objXCN.setEffectiveDate("20030303");
		objXCN.setExpirationDate("20030303");
		objXCN.setProfessionalSuffix("PS");
		objXCN.setAssigningJurisdiction(objCWE);
		objXCN.setAssigningAgencyOrDepartment(objCWE);
		objXCN.setSecurityCheck("strSecurityCheck");
		objXCN.setSecurityCheckScheme("strSecurityCheckScheme");
		
		CX objCX = new CX();
		objCX.setIdNumber("1");
		objCX.setCheckDigit("8");
		objCX.setCheckDigitScheme("NPI");
		objCX.setAssigningAuthority(objHD);
		objCX.setIdentifierTypeCode("AN");
		objCX.setAssigningFacility(objHD);
		objCX.setEffectiveDate("20040304");
		objCX.setExpirationDate("20040305");
		objCX.setAssigningJurisdiction(objCWE);
		objCX.setAssigningAgencyOrDepartment(objCWE);
		objCX.setSecurityCheck("strSecurityCheck");
		objCX.setSecurityCheckScheme("strSecurityCheckScheme");
		
		PRL objPRL = new PRL();
		objPRL.setParentObservationIdentifier(objCWE);
		objPRL.setParentObservationSubidentifier("AB");
		objPRL.setParentObservationValueDescriptor("AB");
		
		MO objPrice = new MO();
		objPrice.setQuantity("99");
		objPrice.setDenomination("USD");
		
		SAD objSAD = new SAD();
		objSAD.setStreetOrMailingAddress("AB");
		objSAD.setStreetName("AB");
		objSAD.setDwellingNumber("AB");
		
		XAD objXAD = new XAD();
		objXAD.setStreetAddress(objSAD);
		objXAD.setOtherDesignation("OD");
		objXAD.setCity("CTY");
		objXAD.setStateOrProvince("State");
		objXAD.setZipOrPostalCode("456789");
		objXAD.setCountry("IND");
		objXAD.setAddressType("BA");
		objXAD.setOtherGeographicDesignation("OD");
		objXAD.setCountyParishCode("1N");
		objXAD.setCensusTract("1289");
		objXAD.setAddressRepresentationCode("I");
		objXAD.setEffectiveDate(objEffectiveDate);
		objXAD.setExpirationDate(objExpirationDate);
		objXAD.setAddressee("ADDS");
		objXAD.setAddressIdentifier(objEI);
		objXAD.setAddressUsage("ADDU");
		objXAD.setBadAddressIndicator("BADDI");
		objXAD.setComment("CMT");
		objXAD.setCountyParishCode("INDPC");
		objXAD.setExpirationReason(objCWE);
		objXAD.setPreferenceOrder("PRFO");
		objXAD.setProtectionCode(objCWE);
		objXAD.setTemporaryIndicator("TEMPI");
		
		//ORC Segment
		ORC objORC = new ORC(); 
		objORC.setOrderControl("F");
		objORC.setPlacerOrderNumber("E id", "N", "U Id", "x500");//EI
		objORC.setFillerOrderNumber("E id", "N", "U Id", "x500");//EI
		objORC.setPlacerGroupNumber(objEI, objEI);
		objORC.setOrderStatus("A");//ID
		objORC.setResponseFlag("E");//ID
		objORC.setParent(objEI, objEI);//EIP
		objORC.addEnteredBy(objXCN);
		objORC.addVerifiedBy(objXCN);//XCN
		objORC.addOrderingProvider(objXCN);//XCN
		objORC.setEntererLocation(objHD,objHD,objHD, null, "LOC_status", "H","Building", "Floor","LocationDescription", null, null);//PL
		objORC.addCallBackPhNo(objXTN);//XTN
		objORC.setOrderControlCodeReason(objCWE);//CE
		objORC.setEnteringOrganization(objCWE);//CE
		objORC.setEnteringDevice(objCWE);//CE
		objORC.addActionBy(objXCN);//XCN
		objORC.setAdvancedBeneficiaryNoticeCode(objCWE);//CE
		objORC.addOrderingFacilityName("strOrganizationName", objCWE, objHD, "strIdentifierTypeCode", objHD, "strNameRepresentationCode", "strOrganizationIdentifier");//XON
		objORC.addOrderingFacilityAddress(objXAD);//XAD
		objORC.addOrderingFacilityPhNo(objXTN);//XTN
		objORC.addOrderingProviderAddress(objXAD);//XAD
		objORC.setOrderStatusModifier(objCWE);//CWE
		objORC.setAdvancedBeneficiaryNoticeOverrideReason(objCWE);//CWE
		objORC.setConfidentialityCode(objCWE);//CWE
		objORC.setOrderType(objCWE);//CWE
		objORC.setEntererAuthorizationMode(objCNE);//CNE
		objORC.setParentUniversalServiceIdentifier(objCWE);
		objORC.setAdvancedBeneficiaryNoticeDate("strTransferToBadDebtDate");
		objORC.addAlternatePlacerOrderNumber(objCX);
		objORC.addOrderWorkflowProfile(objCWE);
		return objORC;
	}

	/**
	 * populates OBR Segment
	 * @return OBR
	 */
	private OBR populateOBR()
	{
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");

		
		EI objEI = new EI();
		objEI.setEntityIdentifier("AB");
		objEI.setNamespaceId("AB");
		objEI.setUniversalId("AB");
		objEI.setUniversalIdType("DNS");
		
		HD objHD = new HD();
		objHD.setNamespaceId("REGAD1");
		objHD.setUniversalId("UI2");
		objHD.setUniversalIdType("GUID");

		XTN objXTN = new XTN();
		objXTN.setLocalNumber("Telephone Number");
		objXTN.setTelecommunicationUseCode("ORN");
		objXTN.setTelecommunicationEquipmentType("Internet");
		objXTN.setCountryCode("546");
		objXTN.setAreaCityCode("54321");
		objXTN.setLocalNumber("123456789");
		objXTN.setExtension("67890");
		objXTN.setAnyText("Any Text");
		objXTN.setExtensionPrefix("EP");
		objXTN.setSpeedDialCode("SDC");
		objXTN.setUnformattedTelephonenumber("1-800-Dentist");
		
		CNE objCNE = new CNE();
		objCNE.setIdentifier("I");
		objCNE.setText("T");
		objCNE.setNameOfCodingSystem("Coding");
		objCNE.setAlternateIdentifier("A");
		objCNE.setAlternateText("T");
		objCNE.setNameOfAlternateCodingSystem("System");
		objCNE.setCodingSystemVersionID("V");
		objCNE.setAlternateCodingSystemVersionID("S");
		objCNE.setOriginalText("O");
		objCNE.setSecondAlternateIdentifier("strSecondAlternateIdentifier");
		objCNE.setSecondAlternateText("strSecondAlternateText");
		objCNE.setNameofSecondAlternateCodingSystem("strNameofSecondAlternateCodingSystem");
		objCNE.setSecondAlternateCodingSystemVersionID("strSecondAlternateCodingSystemVersionID");
		objCNE.setCodingSystemOID("strCodingSystemOID");
		objCNE.setValueSetOID("strValueSetOID");
		objCNE.setValueSetVersionID("strValueSetVersionID");
		objCNE.setAlternateCodingSystemOID("strAlternateCodingSystemOID");
		objCNE.setAlternateValueSetOID("strAlternateValueSetOID");
		objCNE.setAlternateValueSetVersionID("strAlternateValueSetVersionID");
		objCNE.setSecondAlternateCodingSystemOID("strSecondAlternateCodingSystemOID");
		objCNE.setSecondAlternateValueSetOID("strSecondAlternateValueSetOID");
		objCNE.setSecondAlternateValueSetVersionID("AVSID");
		FN objFN = new FN();
		objFN.setSurname("AB");
		objFN.setOwnSurnamePrefix("AB");
		objFN.setOwnSurname("AB");
		objFN.setSurnamePrefixFromPartnerSpouse("AB");
		objFN.setSurnameFromPartnerSpouse("AB");
	
		XCN objXCN = new XCN();
		objXCN.setIdNumber("1");
		objXCN.setFamilyName(objFN);
		objXCN.setGivenName("Anurag");
		objXCN.setSecondNameOrInitials("Anu");
		objXCN.setSuffix("A");
		objXCN.setPrefix("K");
		objXCN.setSourceTable("297");
		objXCN.setAssigningAuthority(objHD);
		objXCN.setNameTypeCode("A");
		objXCN.setIdentifierCheckDigit("7");
		objXCN.setCheckDigitScheme("NPI");
		objXCN.setIdentifierTypeCode("AM");
		objXCN.setAssigningFacility(objHD);
		objXCN.setNameRepresentationCode("I");
		objXCN.setNameContext(objCWE);
		objXCN.setNameAssemblyOrder("F");
		objXCN.setEffectiveDate("20030303");
		objXCN.setExpirationDate("20030303");
		objXCN.setProfessionalSuffix("PS");
		objXCN.setAssigningJurisdiction(objCWE);
		objXCN.setAssigningAgencyOrDepartment(objCWE);
		objXCN.setSecurityCheck("strSecurityCheck");
		objXCN.setSecurityCheckScheme("strSecurityCheckScheme");
		
		CX objCX = new CX();
		objCX.setIdNumber("1");
		objCX.setCheckDigit("8");
		objCX.setCheckDigitScheme("NPI");
		objCX.setAssigningAuthority(objHD);
		objCX.setIdentifierTypeCode("AN");
		objCX.setAssigningFacility(objHD);
		objCX.setEffectiveDate("20040304");
		objCX.setExpirationDate("20040305");
		objCX.setAssigningJurisdiction(objCWE);
		objCX.setAssigningAgencyOrDepartment(objCWE);
		objCX.setSecurityCheck("strSecurityCheck");
		objCX.setSecurityCheckScheme("strSecurityCheckScheme");
		
		PRL objPRL = new PRL();
		objPRL.setParentObservationIdentifier(objCWE);
		objPRL.setParentObservationSubidentifier("AB");
		objPRL.setParentObservationValueDescriptor("AB");
		
		MO objPrice = new MO();
		objPrice.setQuantity("99");
		objPrice.setDenomination("USD");
		
		//OBR Segment
		OBR objOBR = new OBR();
		objOBR.setSetID_OBR("2");//SI
		objOBR.setPlacerOrderNumber("E ID", "N", "U Id", "x500");//EI
		objOBR.setFillerOrderNumber("E ID", "N", "U Id", "x500");//EI
		objOBR.setUniversalServiceIdentifier(objCWE);//CWE
		objOBR.setCollectionVolume("5", objCWE);//CQ
		objOBR.addCollectorIdentifier(objXCN);//XCN
		objOBR.setSpecimenActionCode("A");//ID
		objOBR.setDangerCode(objCWE);//CWE
		objOBR.addRelevantClinicalInformation(objCWE);//ST
		objOBR.addOrderingProvider(objXCN);//XCN
		objOBR.addOrderCallbackPhoneNumber(objXTN);//XTN
		objOBR.setPlacerField1("A");//ST
		objOBR.setPlacerField2("A");//ST
		objOBR.setFillerField1("A");//ST
		objOBR.setFillerField2("A");//ST
		objOBR.setChargetoPractice(objPrice, objCWE);//MOC
		objOBR.setDiagnosticServSectID("AU");//ID
		objOBR.setResultStatus("A");//ID
		objOBR.setParentResult(objPRL);
		objOBR.addResultCopiesTo(objXCN);//XCN
		objOBR.setParent(objEI, objEI);//EIP
		objOBR.setTransportationMode("CART");//ID
		objOBR.addReasonforStudy(objCWE);//CWE
		objOBR.setPrincipalResultInterpreter(null, null, null, "Confirm", "Confirm", "Confirm", null, "Confirm", "Confirm", "Confirm", "Confirm");//NDL
		objOBR.addAssistantResultInterpreter(null, null, null, "Confirm", "Confirm", "Confirm", null, "Confirm", "Confirm", "Confirm", "Confirm");//NDL
		objOBR.addTechnician(null, null, null, "Confirm", "Confirm", "Confirm", null, "Confirm", "Confirm", "Confirm", "Confirm");//NDL
		objOBR.addTranscriptionist(null, null, null, "Confirm", "Confirm", "Confirm", objHD, "Confirm", "Confirm", "Confirm", "Confirm");//NDL
		
		objOBR.setNumberofSampleContainers("123");//NM
		objOBR.addTransportLogisticsofCollectedSample(objCWE);//CWE
		objOBR.addCollectorComment(objCWE);//CWE
		objOBR.setTransportArrangementResponsibility(objCWE);//CWE
		objOBR.setTransportArranged("A");//ID
		objOBR.setEscortRequired("R");//ID
		objOBR.addPlannedPatientTransportComment(objCWE);//CWE
		objOBR.setProcedureCode(objCNE);//CNE
		objOBR.addProcedureCodeModifier(objCNE);//CNE
		objOBR.addPlacerSupplementalServiceInformation(objCWE);//CWE
		objOBR.addFillerSupplementalServiceInformation(objCWE);//CWE
		objOBR.setMedicallyNecessaryDuplicateProcedureReason(objCWE);//CWE
		objOBR.setResultHandling(objCWE);//IS
		objOBR.setParentUniversalServiceIdentifier(objCWE);//CWE
		objOBR.setObservationGroupID(objEI);
		objOBR.setParentObservationGroupID(objEI);
		objOBR.addAlternatePlacerOrderNumber(objCX);
		objOBR.setParentOrder(objEI, objEI);
		return objOBR;
	}

	/**
	 * populates TQ1 Segment
	 * @return TQ1
	 */
	private TQ1 populateTQ1()
	{
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");

		//TQ1 segment
		TQ1 objTQ1 = new TQ1(); 
		objTQ1.setSetID_TQ1("2");//SI
		objTQ1.setQuantity("5", objCWE);//CQ
		
		objTQ1.addRepeatPattern(objCWE, "1", "1", "2", "5", "2", "3", "2", "1", "1", "QD");//RPT
		objTQ1.addExplicitTime("093544.2312");//TM
		objTQ1.addRelativeTimeAndUnits("5", objCWE);//CQ
		objTQ1.setServiceDuration("5", objCWE);//CQ
		
		objTQ1.addPriority(objCWE);//CWE
		objTQ1.setConditionText("Condition text");//TX
		objTQ1.setTextInstruction("Text instruction");//TX
		objTQ1.setConjunction("S");
		objTQ1.setOccurrenceDuration("5", objCWE);//CQ
		objTQ1.setTotalOccurrences("5");//NM
		return objTQ1;
	}

	/**
	 * populates TQ2 Segment
	 * @return TQ2
	 */
	private TQ2 populateTQ2()
	{
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");

		TQ2 objTQ2 = new TQ2();
		objTQ2.setSetID_TQ2("3");//SI
		objTQ2.setSequenceResultsFlag("S");//ID
		objTQ2.addRelatedPlacerNo("GID", "GID", "GID", "GID");//EI
		objTQ2.addRelatedFillerNo("Enier", "NA", "UId", "x500");//EI
		objTQ2.addRelatedPlacerGroupNo("Enier", "NA", "UId", "x500");//EI
		objTQ2.setSequenceConditionCode("EE");//ID
		objTQ2.setCyclicEntryExitIndicator("*");//ID
		objTQ2.setSequenceCondTimeInterval("5", objCWE);//CQ
		objTQ2.setCyclicGroupMaxNoOfRepeats("5");//NM
		objTQ2.setSpecialServiceRequestRelationship("N");//ID
		return objTQ2;
	}

	/**
	 * populates CTD Segment
	 * @return CTD
	 */
	private CTD populateCTD()
	{
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");
		EI objComprehensiveLocationIdentifier = new EI();
		objComprehensiveLocationIdentifier.setEntityIdentifier("Entity Identifier");
		objComprehensiveLocationIdentifier.setNamespaceId("NAMESPACE");
		objComprehensiveLocationIdentifier.setUniversalId("UniversalId");
		objComprehensiveLocationIdentifier.setUniversalIdType("x500");
		
		XTN objXTN = new XTN();
		objXTN.setLocalNumber("Telephone Number");
		objXTN.setTelecommunicationUseCode("ORN");
		objXTN.setTelecommunicationEquipmentType("Internet");
		objXTN.setCountryCode("546");
		objXTN.setAreaCityCode("54321");
		objXTN.setLocalNumber("123456789");
		objXTN.setExtension("67890");
		objXTN.setAnyText("Any Text");
		objXTN.setExtensionPrefix("EP");
		objXTN.setSpeedDialCode("SDC");
		objXTN.setUnformattedTelephonenumber("1-800-Dentist");
		
		FN objFN = new FN();
		objFN.setSurname("AB");
		objFN.setOwnSurnamePrefix("AB");
		objFN.setOwnSurname("AB");
		objFN.setSurnamePrefixFromPartnerSpouse("AB");
		objFN.setSurnameFromPartnerSpouse("AB");
		
		XPN objXPN = new XPN();
		objXPN.setFamilyName(objFN);
		objXPN.setGivenName("anurag");
		objXPN.setSecondNameOrInitials("kulk");
		objXPN.setSuffix("w");
		objXPN.setPrefix("p");
		objXPN.setNameTypeCode("A");
		objXPN.setNameRepresentationCode("I");
		objXPN.setNameContext(objCWE);
		objXPN.setNameAssemblyOrder("G");
		objXPN.setProfessionalSuffix("TXT");
		objXPN.setCalledBy("strCalledBy");
		SAD objSAD = new SAD();
		objSAD.setStreetOrMailingAddress("AB");
		objSAD.setStreetName("AB");
		objSAD.setDwellingNumber("AB");
		
		EI objEI = new EI();
		objEI.setEntityIdentifier("AB");
		objEI.setNamespaceId("AB");
		objEI.setUniversalId("AB");
		objEI.setUniversalIdType("DNS");
		
		HD objHD = new HD();
		objHD.setNamespaceId("REGAD1");
		objHD.setUniversalId("UI2");
		objHD.setUniversalIdType("GUID");
		
		XAD objXAD = new XAD();
		objXAD.setStreetAddress(objSAD);
		objXAD.setOtherDesignation("OD");
		objXAD.setCity("CTY");
		objXAD.setStateOrProvince("State");
		objXAD.setZipOrPostalCode("456789");
		objXAD.setCountry("IND");
		objXAD.setAddressType("BA");
		objXAD.setOtherGeographicDesignation("OD");
		objXAD.setCountyParishCode("1N");
		objXAD.setCensusTract("1289");
		objXAD.setAddressRepresentationCode("I");
		objXAD.setEffectiveDate(objEffectiveDate);
		objXAD.setExpirationDate(objExpirationDate);
		objXAD.setAddressee("ADDS");
		objXAD.setAddressIdentifier(objEI);
		objXAD.setAddressUsage("ADDU");
		objXAD.setBadAddressIndicator("BADDI");
		objXAD.setComment("CMT");
		objXAD.setCountyParishCode("INDPC");
		objXAD.setExpirationReason(objCWE);
		objXAD.setPreferenceOrder("PRFO");
		objXAD.setProtectionCode(objCWE);
		objXAD.setTemporaryIndicator("TEMPI");
	
		PL objPL = new PL();
		objPL.setPointOfCare(objHD);
		objPL.setRoom(objHD);
		objPL.setBed(objHD);
		objPL.setFacility(objHD);
		objPL.setLocationStatus("AB");
		objPL.setPersonLocationType("C");
		objPL.setBuilding("H");
		objPL.setFloor("AB");
		objPL.setLocationDescription("AB");
		objPL.setComprehensiveLocationIdentifier(objEI);
		objPL.setAssigningAuthorityForLocation(objHD);
		//CTD segment
		CTD objCTD = new CTD();
		objCTD.addContactRole(objCWE);
		objCTD.addContactName(objXPN);//XPN
		objCTD.addContactAddress(objXAD);//XAD
		objCTD.setContactLocation(objPL);
		objCTD.addContactCommunicationInformation(objXTN);//XTN
		objCTD.setPreferredMethodContact(objCWE);//CE
		objCTD.addContactIdentifiers("strIdNumber", objCWE, "strStateOtherQualifyingInfo", "strExpirationDate");
		return objCTD;
	}

	/**
	 * populates OBX Segment
	 * @return OBX
	 */
	public  OBX populateOBX()
	{	
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");
		
		CNE objCNE = new CNE();
		objCNE.setIdentifier("I");
		objCNE.setText("T");
		objCNE.setNameOfCodingSystem("Coding");
		objCNE.setAlternateIdentifier("A");
		objCNE.setAlternateText("T");
		objCNE.setNameOfAlternateCodingSystem("System");
		objCNE.setCodingSystemVersionID("V");
		objCNE.setAlternateCodingSystemVersionID("S");
		objCNE.setOriginalText("O");
		objCNE.setSecondAlternateIdentifier("strSecondAlternateIdentifier");
		objCNE.setSecondAlternateText("strSecondAlternateText");
		objCNE.setNameofSecondAlternateCodingSystem("strNameofSecondAlternateCodingSystem");
		objCNE.setSecondAlternateCodingSystemVersionID("strSecondAlternateCodingSystemVersionID");
		objCNE.setCodingSystemOID("strCodingSystemOID");
		objCNE.setValueSetOID("strValueSetOID");
		objCNE.setValueSetVersionID("strValueSetVersionID");
		objCNE.setAlternateCodingSystemOID("strAlternateCodingSystemOID");
		objCNE.setAlternateValueSetOID("strAlternateValueSetOID");
		objCNE.setAlternateValueSetVersionID("strAlternateValueSetVersionID");
		objCNE.setSecondAlternateCodingSystemOID("strSecondAlternateCodingSystemOID");
		objCNE.setSecondAlternateValueSetOID("strSecondAlternateValueSetOID");
		objCNE.setSecondAlternateValueSetVersionID("AVSID");
		
		FN objFN = new FN();
		objFN.setSurname("AB");
		objFN.setOwnSurnamePrefix("AB");
		objFN.setOwnSurname("AB");
		objFN.setSurnamePrefixFromPartnerSpouse("AB");
		objFN.setSurnameFromPartnerSpouse("AB");
		
		HD objHD = new HD();
		objHD.setNamespaceId("REGAD1");
		objHD.setUniversalId("UI2");
		objHD.setUniversalIdType("GUID");
	
		XCN objXCN = new XCN();
		objXCN.setIdNumber("1");
		objXCN.setFamilyName(objFN);
		objXCN.setGivenName("Anurag");
		objXCN.setSecondNameOrInitials("Anu");
		objXCN.setSuffix("A");
		objXCN.setPrefix("K");
		objXCN.setSourceTable("297");
		objXCN.setAssigningAuthority(objHD);
		objXCN.setNameTypeCode("A");
		objXCN.setIdentifierCheckDigit("7");
		objXCN.setCheckDigitScheme("NPI");
		objXCN.setIdentifierTypeCode("AM");
		objXCN.setAssigningFacility(objHD);
		objXCN.setNameRepresentationCode("I");
		objXCN.setNameContext(objCWE);
		objXCN.setNameAssemblyOrder("F");
		objXCN.setEffectiveDate("20030303");
		objXCN.setExpirationDate("20030303");
		objXCN.setProfessionalSuffix("PS");
		objXCN.setAssigningJurisdiction(objCWE);
		objXCN.setAssigningAgencyOrDepartment(objCWE);
		objXCN.setSecurityCheck("strSecurityCheck");
		objXCN.setSecurityCheckScheme("strSecurityCheckScheme");
		
		SAD objSAD = new SAD();
		objSAD.setStreetOrMailingAddress("AB");
		objSAD.setStreetName("AB");
		objSAD.setDwellingNumber("AB");
		
		EI objEI = new EI();
		objEI.setEntityIdentifier("AB");
		objEI.setNamespaceId("AB");
		objEI.setUniversalId("AB");
		objEI.setUniversalIdType("DNS");
		
		XAD objXAD = new XAD();
		objXAD.setStreetAddress(objSAD);
		objXAD.setOtherDesignation("OD");
		objXAD.setCity("CTY");
		objXAD.setStateOrProvince("State");
		objXAD.setZipOrPostalCode("456789");
		objXAD.setCountry("IND");
		objXAD.setAddressType("BA");
		objXAD.setOtherGeographicDesignation("OD");
		objXAD.setCountyParishCode("1N");
		objXAD.setCensusTract("1289");
		objXAD.setAddressRepresentationCode("I");
		objXAD.setEffectiveDate(objEffectiveDate);
		objXAD.setExpirationDate(objExpirationDate);
		objXAD.setAddressee("ADDS");
		objXAD.setAddressIdentifier(objEI);
		objXAD.setAddressUsage("ADDU");
		objXAD.setBadAddressIndicator("BADDI");
		objXAD.setComment("CMT");
		objXAD.setCountyParishCode("INDPC");
		objXAD.setExpirationReason(objCWE);
		objXAD.setPreferenceOrder("PRFO");
		objXAD.setProtectionCode(objCWE);
		objXAD.setTemporaryIndicator("TEMPI");
		
		CX objCX = new CX();
		objCX.setIdNumber("1");
		objCX.setCheckDigit("8");
		objCX.setCheckDigitScheme("NPI");
		objCX.setAssigningAuthority(objHD);
		objCX.setIdentifierTypeCode("AN");
		objCX.setAssigningFacility(objHD);
		objCX.setEffectiveDate("20040304");
		objCX.setExpirationDate("20040305");
		objCX.setAssigningJurisdiction(objCWE);
		objCX.setAssigningAgencyOrDepartment(objCWE);
		objCX.setSecurityCheck("strSecurityCheck");
		objCX.setSecurityCheckScheme("strSecurityCheckScheme");
		
		XTN objXTN = new XTN();
		objXTN.setLocalNumber("Telephone Number");
		objXTN.setTelecommunicationUseCode("ORN");
		objXTN.setTelecommunicationEquipmentType("Internet");
		objXTN.setCountryCode("546");
		objXTN.setAreaCityCode("54321");
		objXTN.setLocalNumber("123456789");
		objXTN.setExtension("67890");
		objXTN.setAnyText("Any Text");
		objXTN.setExtensionPrefix("EP");
		objXTN.setSpeedDialCode("SDC");
		objXTN.setUnformattedTelephonenumber("1-800-Dentist");
		
		XPN objXPN = new XPN();
		objXPN.setFamilyName(objFN);
		objXPN.setGivenName("anurag");
		objXPN.setSecondNameOrInitials("kulk");
		objXPN.setSuffix("w");
		objXPN.setPrefix("p");
		//objXPN.setDegree("BE");
		objXPN.setNameTypeCode("A");
		objXPN.setNameRepresentationCode("I");
		objXPN.setNameContext(objCWE);
		objXPN.setNameAssemblyOrder("G");
		objXPN.setEffectiveDate("20040304");
		objXPN.setExpirationDate("20040304");
		objXPN.setProfessionalSuffix("TXT");
		objXPN.setCalledBy("strCalledBy");
		
		MO objPrice = new MO();
		objPrice.setQuantity("99");
		objPrice.setDenomination("USD");

		//OBX segment
		OBX objOBX = new OBX();
		OG objOG = new OG();
		objOBX.setSetID_OBX("1234");
		objOBX.setValueType("CE");
		objOBX.setObservationIdentifier(objCWE);
		objOBX.setObservationSubID(objOG);
		objOBX.addObservationValue(objCWE);
		objOBX.setUnits(objCWE);
		objOBX.setReferencesRange("References Range");
		objOBX.addAbnormalFlags(objCWE);
		objOBX.setProbability("1");
		objOBX.addNatureOfAbnormalTest("SP");
		objOBX.setObservationResultStatus("U");
		objOBX.setUserDefinedAccessChecks("user_defined");
		objOBX.setProducersID(objCWE);
		objOBX.addResponsibleObserver(objXCN);
		objOBX.addObservationMethod(objCWE);
		objOBX.addEquipmentInstanceIdentifier("En", "NA", "Un Id", "x500");
		objOBX.addObservationSite(objCWE);
		objOBX.setObservationInstanceIdentifier("strEntityIdentifier", "strNamespaceId", "strUniversalId", "strUniversalIdType");
		
		objOBX.setMoodCode(objCNE);
		
		objOBX.setPerformingOrganizationName("strOrganizationName", objCWE, objHD, "strIdentifierTypeCode", objHD, "strNameRepresentationCode", "strOrganizationIdentifier");
		
		objOBX.setPerformingOrganizationAddress(objXAD);
		
		objOBX.setPerformingOrganizationMedicalDirector(objXCN);
		objOBX.setPatientResultsReleaseCategory("strPatientResultsReleaseCategory");
		objOBX.setRootCause(objCWE);
		objOBX.setLocalProcessControl(objCWE);
		objOBX.setObservationType("strObjObservationType");
		objOBX.setObservationSubType("strObservationSubType");
		return objOBX;
	}


	/**
	 * populates FT1 Segment
	 * @return FT1
	 */
	private FT1 populateFT1()
	{
		//FT1 segment
		
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");
		
		CNE objCNE = new CNE();
		objCNE.setIdentifier("I");
		objCNE.setText("T");
		objCNE.setNameOfCodingSystem("Coding");
		objCNE.setAlternateIdentifier("A");
		objCNE.setAlternateText("T");
		objCNE.setNameOfAlternateCodingSystem("System");
		objCNE.setCodingSystemVersionID("V");
		objCNE.setAlternateCodingSystemVersionID("S");
		objCNE.setOriginalText("O");
		objCNE.setSecondAlternateIdentifier("strSecondAlternateIdentifier");
		objCNE.setSecondAlternateText("strSecondAlternateText");
		objCNE.setNameofSecondAlternateCodingSystem("strNameofSecondAlternateCodingSystem");
		objCNE.setSecondAlternateCodingSystemVersionID("strSecondAlternateCodingSystemVersionID");
		objCNE.setCodingSystemOID("strCodingSystemOID");
		objCNE.setValueSetOID("strValueSetOID");
		objCNE.setValueSetVersionID("strValueSetVersionID");
		objCNE.setAlternateCodingSystemOID("strAlternateCodingSystemOID");
		objCNE.setAlternateValueSetOID("strAlternateValueSetOID");
		objCNE.setAlternateValueSetVersionID("strAlternateValueSetVersionID");
		objCNE.setSecondAlternateCodingSystemOID("strSecondAlternateCodingSystemOID");
		objCNE.setSecondAlternateValueSetOID("strSecondAlternateValueSetOID");
		objCNE.setSecondAlternateValueSetVersionID("AVSID");
		
		FN objFN = new FN();
		objFN.setSurname("AB");
		objFN.setOwnSurnamePrefix("AB");
		objFN.setOwnSurname("AB");
		objFN.setSurnamePrefixFromPartnerSpouse("AB");
		objFN.setSurnameFromPartnerSpouse("AB");
		
		HD objHD = new HD();
		objHD.setNamespaceId("REGAD1");
		objHD.setUniversalId("UI2");
		objHD.setUniversalIdType("GUID");
	
		XCN objXCN = new XCN();
		objXCN.setIdNumber("1");
		objXCN.setFamilyName(objFN);
		objXCN.setGivenName("Anurag");
		objXCN.setSecondNameOrInitials("Anu");
		objXCN.setSuffix("A");
		objXCN.setPrefix("K");
		objXCN.setSourceTable("297");
		objXCN.setAssigningAuthority(objHD);
		objXCN.setNameTypeCode("A");
		objXCN.setIdentifierCheckDigit("7");
		objXCN.setCheckDigitScheme("NPI");
		objXCN.setIdentifierTypeCode("AM");
		objXCN.setAssigningFacility(objHD);
		objXCN.setNameRepresentationCode("I");
		objXCN.setNameContext(objCWE);
		objXCN.setNameAssemblyOrder("F");
		objXCN.setEffectiveDate("20030303");
		objXCN.setExpirationDate("20030303");
		objXCN.setProfessionalSuffix("PS");
		objXCN.setAssigningJurisdiction(objCWE);
		objXCN.setAssigningAgencyOrDepartment(objCWE);
		objXCN.setSecurityCheck("strSecurityCheck");
		objXCN.setSecurityCheckScheme("strSecurityCheckScheme");
		
		CX objCX = new CX();
		objCX.setIdNumber("1");
		objCX.setCheckDigit("8");
		objCX.setCheckDigitScheme("NPI");
		objCX.setAssigningAuthority(objHD);
		objCX.setIdentifierTypeCode("AN");
		objCX.setAssigningFacility(objHD);
		objCX.setEffectiveDate("20040304");
		objCX.setExpirationDate("20040305");
		objCX.setAssigningJurisdiction(objCWE);
		objCX.setAssigningAgencyOrDepartment(objCWE);
		objCX.setSecurityCheck("strSecurityCheck");
		objCX.setSecurityCheckScheme("strSecurityCheckScheme");
		
		EI objComprehensiveLocationIdentifier = new EI();
		objComprehensiveLocationIdentifier.setEntityIdentifier("Entity Identifier");
		objComprehensiveLocationIdentifier.setNamespaceId("NAMESPACE");
		objComprehensiveLocationIdentifier.setUniversalId("UniversalId");
		objComprehensiveLocationIdentifier.setUniversalIdType("x500");
		MO objPrice = new MO();
		objPrice.setQuantity("99");
		//FT1 Segment
		FT1 objFT1 = new FT1();
		objFT1.setSetIDFT1("1");//SI
		objFT1.setTransactionID("A");//ST
		objFT1.setTransactionBatchID("A");//ST
		objFT1.setTransactionDate(objExpirationDate, objExpirationDate);//DR
		objFT1.setTransactionType(objCWE);//IS
		objFT1.setTransactionCode(objCWE);//CE
		objFT1.setTransactionQuantity("5");//NM
		objFT1.setTransactionAmountExtended(objPrice, "strPriceType", "strFromValue", "strToValue", objCWE, "strRangeType");//CP
		objFT1.setTransactionAmountUnit(objPrice, "strPriceType", "strFromValue", "strToValue", objCWE, "strRangeType");//CP
		objFT1.setDepartmentCode(objCWE);//CE
		objFT1.setInsuranceAmount(objPrice, "strPriceType", "strFromValue", "strToValue", objCWE, "strRangeType");//CP
		objFT1.setAssignedPatientLocation(objHD,objHD,objHD, null, "LOC_status", "H","Building", "Floor","LocationDescription", null, null);//PL
		objFT1.setFeeSchedule(objCWE);//IS
		objFT1.setPatientType(objCWE);//IS
		objFT1.addDiagnosisCode_FT1(objCWE);//CE
		objFT1.addPerformedByCode(objXCN);//XCN
		objFT1.addOrderedByCode(objXCN);//XCN
		objFT1.setUnitCost(objPrice, "strPriceType", "strFromValue", "strToValue", objCWE, "strRangeType");//CP
		objFT1.setFillerOrderNumber("Entity Identifier", "NAMESPACE", "UniversalId", "x500");//EI
		objFT1.addEnteredByCode(objXCN);//XCN
		objFT1.setProcedureCode(objCNE);//CE
		objFT1.addProcedureCodeModifier(objCNE);//CE
		objFT1.setAdvancedBeneficiaryNoticeCode(objCWE);//CE
		objFT1.setMedicallyNecessaryDuplicateProcedureReason(objCWE);//CWE
		objFT1.setNDCCode(objCWE);//CNE
		objFT1.setPaymentReferenceID(objCX);//CX
		objFT1.addTransactionReferenceKey("1");//SI
		objFT1.addPerformingFacility("strOrganizationName", objCWE, objHD, "strIdentifierTypeCode", objHD, "strNameRepresentationCode", "strOrganizationIdentifier");
		objFT1.setOrderingFacility("strOrganizationName", objCWE, objHD, "strIdentifierTypeCode", objHD, "strNameRepresentationCode", "strOrganizationIdentifier");
		objFT1.setItemNumber(objCWE);
		objFT1.setModelNumber("MN007");
		objFT1.setSpecialProcessingCode(objCWE);
		objFT1.setClinicCode(objCWE);
		objFT1.setReferralNumber(objCX);
		objFT1.setServiceProviderTaxonomyCode(objCWE);
		objFT1.setRevenueCode(objCWE);
		objFT1.setNDCQtyAndUOM("QTY", objCWE);
		return objFT1;
	}

	/**
	 * populates CTI Segment
	 * @return CTI
	 */
	private CTI populateCTI()
	{
		
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");

		//CTI Segment
		CTI objCTI = new CTI();
		objCTI.setSponsorStudyID("Entity Identifier", "NAMESPACE", "UniversalId", "x500");//EI
		objCTI.setStudyPhaseIdentifier(objCWE);//CE
		objCTI.setStudyScheduledTimePoint(objCWE);//CE
		return objCTI;
	}

	/**
	 * populates SPM Segment
	 * @return SPM
	 */
	private SPM populateSPM()
	{

		EI objEI = new EI();
		objEI.setEntityIdentifier("Enr");
		objEI.setNamespaceId("NAE");
		objEI.setUniversalId("Un Id");
		objEI.setUniversalIdType("x500");
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");

		//SPM segment
		SPM objSPM = new SPM();
		objSPM.setSetID_SPM("8");//SI
		objSPM.setSpecimenID(objEI, objEI);//EIP
		objSPM.addSpecimenParentIDs(objEI, objEI);//EIP
		objSPM.setSpecimenType(objCWE);//CWE
		objSPM.addSpecimenTypeModifier(objCWE);//CWE
		objSPM.addSpecimenAdditives(objCWE);//CWE
		objSPM.setSpecimenCollectionMethod(objCWE);//CWE
		objSPM.setSpecimenSourceSite(objCWE);//CWE
		objSPM.addSpecimenSourceSiteModifier(objCWE);//CWE
		objSPM.setSpecimenCollectionSite(objCWE);//CWE
		objSPM.addSpecimenRole(objCWE);//CWE
		objSPM.setSpecimenCollectionAmount("5", objCWE);//CQ
		objSPM.setGroupedSpecimenCount("5");//NM
		objSPM.addSpecimenDescription("A");//ST
		objSPM.addSpecimenHandlingCode(objCWE);//CWE
		objSPM.addSpecimenRiskCode(objCWE);//CWE
		objSPM.setSpecimenCollectionDateTime(objEffectiveDate, objExpirationDate);//DR
		objSPM.setSpecimenAvailability("Y");
		objSPM.addSpecimenRejectReason(objCWE);//CWE
		objSPM.setSpecimenQuality(objCWE);//CWE
		objSPM.setSpecimenAppropriateness(objCWE);//CWE
		objSPM.addSpecimenCondition(objCWE);//CWE
		objSPM.setSpecimenCurrentQuantity("5", objCWE);//CQ
		objSPM.setNumberofSpecimenContainers("5");//NM
		objSPM.setContainerType(objCWE);//CWE
		objSPM.setContainerCondition(objCWE);//CWE
		objSPM.setSpecimenChildRole(objCWE);//CWE
		objSPM.addAccessionID("strIDNumber", "strCheckDigit", "strCheckDigitScheme", objAssigningAuthority, "strIdentifierTypeCode", objAssigningFacility, "strEffectiveDate", "strExpirationDate", objCWE, objCWE, "strSecurityCheck", "strSecurityCheckScheme");
		objSPM.setShipmentID(objEI);
		return objSPM;
	}

	/**
	 * populates DSC Segment
	 * @return DSC
	 */
	private DSC populateDSC()
	{
		//DSC Segment
		DSC objDSC = new DSC();
		objDSC.setContinuationPointer("Pointer");
		objDSC.setContinuationStyle("F");
		return objDSC;
	}
	
	/**
	 * populates TXA Segment
	 * @return TXA
	 */
	public TXA populateTXA()
	{
		EI objEI = new EI();
		objEI.setEntityIdentifier("Enr");
		objEI.setNamespaceId("NAE");
		objEI.setUniversalId("Un Id");
		objEI.setUniversalIdType("x500");
		CWE objCWE = new CWE();
		objCWE.setIdentifier("AB");
		objCWE.setText("AB");
		objCWE.setNameOfCodingSystem("ACR");
		objCWE.setAlternateIdentifier("AB");
		objCWE.setAlternateText("AB");
		objCWE.setNameOfAlternateCodingSystem("ACR");
		objCWE.setCodingSystemVersionID("H");
		objCWE.setAlternateCodingSystemVersionId("AB");
		objCWE.setOriginalText("AB");
		objCWE.setAlternateCodingSystemOID("ACSOID");
		objCWE.setAlternateValueSetOID("AVSOID");
		objCWE.setCodingSystemOID("CSOID");
		objCWE.setValueSetVersionID("VERID");
		objCWE.setValueSetOID("VSOID");
		objCWE.setSecondAlternateValueSetVersionID("SAVSID");
		objCWE.setSecondAlternateValueSetOID("SAVOID");
		objCWE.setSecondAlternateText("TEXT2");
		objCWE.setSecondAlternateIdentifier("SALTI");
		objCWE.setSecondAlternateCodingSystemVersionID("SACSVID");
		objCWE.setSecondAlternateCodingSystemOID("SACSOID");
		objCWE.setNameofSecondAlternateCodingSystem("HL72");
		objCWE.setAlternateValueSetVersionID("AVSID");
		FN objFN = new FN();
		objFN.setSurname("AB");
		objFN.setOwnSurnamePrefix("AB");
		objFN.setOwnSurname("AB");
		objFN.setSurnamePrefixFromPartnerSpouse("AB");
		objFN.setSurnameFromPartnerSpouse("AB");
		
		HD objHD = new HD();
		objHD.setNamespaceId("REGAD1");
		objHD.setUniversalId("UI2");
		objHD.setUniversalIdType("GUID");
	
		XCN objXCN = new XCN();
		objXCN.setIdNumber("1");
		objXCN.setFamilyName(objFN);
		objXCN.setGivenName("Anurag");
		objXCN.setSecondNameOrInitials("Anu");
		objXCN.setSuffix("A");
		objXCN.setPrefix("K");
		objXCN.setSourceTable("297");
		objXCN.setAssigningAuthority(objHD);
		objXCN.setNameTypeCode("A");
		objXCN.setIdentifierCheckDigit("7");
		objXCN.setCheckDigitScheme("NPI");
		objXCN.setIdentifierTypeCode("AM");
		objXCN.setAssigningFacility(objHD);
		objXCN.setNameRepresentationCode("I");
		objXCN.setNameContext(objCWE);
		objXCN.setNameAssemblyOrder("F");
		objXCN.setEffectiveDate("20030303");
		objXCN.setExpirationDate("20030303");
		objXCN.setProfessionalSuffix("PS");
		objXCN.setAssigningJurisdiction(objCWE);
		objXCN.setAssigningAgencyOrDepartment(objCWE);
		objXCN.setSecurityCheck("strSecurityCheck");
		objXCN.setSecurityCheckScheme("strSecurityCheckScheme");

		PPN objPPN = new PPN();
		objPPN.setPersonIdentifier("strPersonIdentifier");
		objPPN.setFamilyName(objFN);
		objPPN.setGivenName("AB");
		objPPN.setSecondAndFurtherGivenNamesOrInitialsThereof("AB");
		objPPN.setSuffix("AB");
		objPPN.setPrefix("AB");
		objPPN.setSourceTable("AB");
		objPPN.setAssigningAuthority(objHD);
		objPPN.setNameTypeCode("A");
		objPPN.setIdentifierCheckDigit("A");
		objPPN.setCheckDigitScheme("NPI");
		objPPN.setIdentifierTypeCode("AM");
		objPPN.setAssigningFacility(objHD);
		objPPN.setDateTimeActionPerformed("20030303");
		objPPN.setNameRepresentationCode("I");
		objPPN.setNameContext(objCWE);
		objPPN.setNameAssemblyOrder("G");
		objPPN.setEffectiveDate("20030303");
		objPPN.setExpirationDate("20030303");
		objPPN.setProfessionalSuffix("AB");
		objPPN.setAssigningJurisdiction(objCWE);
		objPPN.setAssigningAgencyOrDepartment(objCWE);
		objPPN.setSecurityCheck("strSecurityCheck");
		objPPN.setSecurityCheckScheme("strSecurityCheckScheme");

		TXA objTXA = new TXA();
		
		objTXA.setSetID_TXA("trSetID_TXA");
		objTXA.setDocumentType(objCWE);//IS
		objTXA.setDocumentContentPresentation("AP");//ID
		objTXA.addPrimaryActivityProviderCodeName(objXCN);//XCN
		objTXA.addOriginatorCodeName(objXCN);//XCN
		objTXA.addAssignedDocumentAuthenticator(objXCN);//XCN
		objTXA.addTranscriptionistCodeName(objXCN);//XCN
		objTXA.setUniqueDocumentNumber("Eid", "Name", "U Id", "x500");//EI
		objTXA.setParentDocumentNumber("Eid", "Name", "U Id", "x500");//EI
		objTXA.addPlacerOrderNumber(objEI);//EI
		objTXA.setFillerOrderNumber("Eid", "Name", "U Id", "x500");//EI
		objTXA.setUniqueDocumentFileName("A");//ST
		objTXA.setDocumentCompletionStatus("DI");//ID
		objTXA.setDocumentConfidentialityStatus("V");//ID
		objTXA.setDocumentAvailabilityStatus("AV");//ID
		objTXA.setDocumentStorageStatus("AC");//ID
		objTXA.setDocumentChangeReason("A");//ST
		objTXA.addAuthenticationPersonTimeStamp(objPPN);//PPN
		objTXA.addDistributedCopies(objXCN);//XCN
		objTXA.addFolderAssignment(objCWE);
		objTXA.addDocumentTitle("strDocumentTitle");
		objTXA.setAgreedDueDateTime("strTime");
		return objTXA;
	}


	@SuppressWarnings("unchecked")
	private String getValue(IDataType objDataType)
	{
		String strDataType = null;
		IMultiValuedPairedCollection<Integer,IDataType> objMultiValuedCollection = (IMultiValuedPairedCollection<Integer,IDataType>)objDataType.getValue();
		ISingleCollection<IDataType> objDataTypeCollection = objMultiValuedCollection.getAllValues();

		for(IDataType objTempDataType : objDataTypeCollection)
		{
			if(objTempDataType!= null && objTempDataType.isPrimitive())
			{
				if(strDataType == null)
					strDataType = (String)objTempDataType.getValue();
				else
					strDataType += (String)objTempDataType.getValue();

				strDataType += ",";
			}
			else if(objTempDataType!= null)
				getCompositeValue(objTempDataType);
		}

		if(strDataType != null)
			return strDataType;
		return null;
	}

	@SuppressWarnings("unchecked")
	private String getCompositeValue(IDataType objDataType)
	{
		String strDataType = null;
		IMultiValuedPairedCollection<Integer,IDataType> objMultiValuedCollection = (IMultiValuedPairedCollection<Integer,IDataType>)objDataType.getValue();
		ISingleCollection<IDataType> objDataTypeCollection = objMultiValuedCollection.getAllValues();

		for(IDataType objTempDataType : objDataTypeCollection)
		{
			if(objTempDataType!= null && objTempDataType.isPrimitive())
			{
				if(strDataType == null)
					strDataType = (String)objTempDataType.getValue();
				else
					strDataType += (String)objTempDataType.getValue();

				strDataType += ",";
			}
			else if(objTempDataType!= null)
				getCompositeValue(objTempDataType);
		}

		if(strDataType != null)
			return strDataType;
		return null;
	}
}
