package cdac.medinfo.sdk.hl7282.hl7model;


import cdac.medinfo.sdk.hl7282.baselibs.CNE;
import cdac.medinfo.sdk.hl7282.baselibs.CWE;
import cdac.medinfo.sdk.hl7282.baselibs.CX;
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.FN;
import cdac.medinfo.sdk.hl7282.baselibs.HD;
import cdac.medinfo.sdk.hl7282.baselibs.MO;
import cdac.medinfo.sdk.hl7282.baselibs.OG;
import cdac.medinfo.sdk.hl7282.baselibs.PL;
import cdac.medinfo.sdk.hl7282.baselibs.PPN;
import cdac.medinfo.sdk.hl7282.baselibs.PRL;
import cdac.medinfo.sdk.hl7282.baselibs.SAD;
import cdac.medinfo.sdk.hl7282.baselibs.XAD;
import cdac.medinfo.sdk.hl7282.baselibs.XCN;
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.segmentfactory.SegmentMapReader;
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.ISegmentSet;
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.IAttributeItem;
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;
import cdac.medinfo.sdk.hl7282.utils.ISegmentMap;

public class ORU_R01_Test 
{
	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);

	ORU_R01_Test()
	{
		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_Test objORU_R01 = new ORU_R01_Test();
		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)
	{
		ISegmentSet objSegmentSet = objMessage.getSegmentSet();
		
		for(int i = 1; i <= objSegmentSet.size(); i++)
		{
			ISegment objSegment = objSegmentSet.getSegment(i-1);

			if(objSegment != null)
			{
				System.out.println("---------------------------------------------------------------------------------------------------------");
				String strSegmentName = objSegment.getName().getValue();
				System.out.println("" + strSegmentName + "::");

				ISegmentMap objSegmentMap = SegmentMapReader.createInstance().getSegmentMap(strSegmentName);
				ISingleCollection<Integer> objItemIDList = objSegmentMap.getItemIDList();

				IMultiValuedPairedCollection<Integer, IDataType> objSegmentsFieldCollection = objSegment.getFields();

				for(int j = 1; j <= objSegmentsFieldCollection.getAllValues().size(); j++)
				{
					IAttributeItem objAttributeItem = objSegmentMap.getAttributeItem(j);
					System.out.println("" + objAttributeItem.getFieldName() + "::");

					if(objItemIDList != null)
					{
						Integer intItemID = objItemIDList.elementAt(j-1);
						ISingleCollection<IDataType> objDataTypeCollection = objSegmentsFieldCollection.get(intItemID);
						if(objDataTypeCollection != null && objDataTypeCollection.size() != 0)
						{
							for(IDataType objDataType : objDataTypeCollection)
							{
								if(objDataType != null)
								{									
									if(objDataType.isPrimitive())
										System.out.println("" + objDataType.getValue());
									else
										getValue(objDataType);
								}
							}
						}
					}
				}
			}
		}
	}

	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);

				//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);
				
				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.setDateTimeOfMessage("20000320");//TS
		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");
		objSFT.setSoftwareInstallDate("20030202");
		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.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.setDateTimeOfBirth("20040304");
		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.setPatientDeathDateTime("20030303");//TS
		objPID.setPatientDeathIndicator("Y");
		objPID.setIdentityUnknownIndicator("N");
		objPID.addIdentityReliabilityCode(objCWE);
		objPID.setLastUpdateDateTime("20030303");
		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);
		objNTE.setEnteredDateTime("20070202");
		objNTE.setEffectiveStartDate("strDate");
		objNTE.setExpirationDate("strTime");
		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.setDateTimeOfBirth("20030303");//TS
		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.setAdmitDateOrTime("20030303");//TS
		objPV1.addDischargeDateOrTime("20030303");//TS
		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.setExpectedAdmitDateOrTime("20030303");//TS
		objPV2.setExpectedDischargeDateOrTime("20030303");//TS
		objPV2.setEstimatedLengthOfInPatientStay("123");
		objPV2.setActualLengthOfInPatientStay("456");
		objPV2.setVisitDescription("VisitDescription");
		objPV2.addReferralSourceCode(objXCN);
		objPV2.setPreviousServiceDate("20050202");
		objPV2.setEmploymentIllnessRelatedIndicator("Y");
		objPV2.setPurgeStatusCode(objCWE);
		objPV2.setPurgeStatusDate("20050202");
		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.setPreviousTreatmentDate("20030202");
		objPV2.setExpectedDischargeDisposition(objCWE);
		objPV2.setSignatureOnFileDate("20080505");
		objPV2.setFirstSimilarIllnessDate("20030202");
		objPV2.setPatientChargeAdjustmentCode(objCWE);
		objPV2.setRecurringServiceCode(objCWE);
		objPV2.setBillingmediaCode("N");
		objPV2.setExpectedSurgeryDateAndTime("20030303");//TS
		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.setPatientStatusEffectiveDate("20040303");
		objPV2.setExpectedLOAReturnDAteOrTime("20030303");//TS
		objPV2.setExpectedPreAdmissionTestingDateOrTime("20030303");//TS
		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.setDateTimeOfTransaction("20070202");//TS
		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.setOrderEffectiveDateTime("20070202");//TS
		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.setFillersExpectedAvailabilityDateTime("20070202");//TS
		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.setObservationDateTime("200702");//DTM
		objOBR.setObservationEndDateTime("200202");//DTM
		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.setResultsRptStatusChng_DateTime("20070202");//DTM
		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.setScheduledDateTime("20070202");//DTM
		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.setStartDateTime("20110202");//TS
		objTQ1.setEndDateTime("20110202");//TS
		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.setEffectiveDate("20040304");
		objXPN.setExpirationDate("20040304");
		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.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.setEffectiveDateOfReferenceRange("20030303");//TS
		objOBX.setUserDefinedAccessChecks("user_defined");
		objOBX.setDtTimeOfObservation("20030303");//TS
		objOBX.setProducersID(objCWE);
		objOBX.addResponsibleObserver(objXCN);
		objOBX.addObservationMethod(objCWE);
		objOBX.addEquipmentInstanceIdentifier("En", "NA", "Un Id", "x500");
		objOBX.setDtTimeOfAnalysis("20030303");//TS
		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.setTransactionPostingDate("20030303");//TS
		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);
		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.setSpecimenReceivedDateTime("20110202");//TS
		objSPM.setSpecimenExpirationDateTime("20110202");//TS
		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.setActivityDateTime("20110202");//TS
		objTXA.addPrimaryActivityProviderCodeName(objXCN);//XCN
		objTXA.setOriginationDateTime("20110202");//TS
		objTXA.setTranscriptionDateTime("20110202");//TS
		objTXA.addEditDateTime("20110202");//TS
		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 void getValue(IDataType objDataType)
	{
		int k = 1;
		IMultiValuedPairedCollection<Integer,IDataType> objMultiValuedCollection = (IMultiValuedPairedCollection<Integer,IDataType>)objDataType.getValue();
		ISingleCollection<IDataType> objDataTypeCollection = objMultiValuedCollection.getAllValues();

		for(IDataType objTempDataType : objDataTypeCollection)
		{
			IDataTypeMap objDataTypeMap = DataTypeMapReader.createInstance().getDataTypeMap(objDataType.getDataTypeName().getValue());
			String strFieldName = objDataTypeMap.getFieldName(k++);
			System.out.print(strFieldName + "-");
			
			if(objTempDataType!= null && objTempDataType.isPrimitive())
			{
				System.out.print((String)objTempDataType.getValue());

				System.out.println(",");
			}
			else if(objTempDataType!= null)
			{				
				 getCompositeValue(objTempDataType);
			}
		}
	}
	
	@SuppressWarnings("unchecked")
	private void getCompositeValue(IDataType objDataType)
	{
		int k = 1;
		IMultiValuedPairedCollection<Integer,IDataType> objMultiValuedCollection = (IMultiValuedPairedCollection<Integer,IDataType>)objDataType.getValue();
		ISingleCollection<IDataType> objDataTypeCollection = objMultiValuedCollection.getAllValues();

		for(IDataType objTempDataType : objDataTypeCollection)
		{
			IDataTypeMap objDataTypeMap = DataTypeMapReader.createInstance().getDataTypeMap(objDataType.getDataTypeName().getValue());
			String strFieldName = objDataTypeMap.getFieldName(k++);
			System.out.println(strFieldName);
			
			if(objTempDataType!= null && objTempDataType.isPrimitive())
			{				
				System.out.print((String)objTempDataType.getValue());
	
				System.out.print(",");
			}
			else if(objTempDataType!= null)
				getCompositeValue(objTempDataType);
		}
	}
}
