/*******************************************************************************
 *  Copyright 2017 Centre for Development of Advanced Computing(C-DAC), Pune
 *  
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  
 *    http://www.apache.org/licenses/LICENSE-2.0
 *  
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *******************************************************************************/
package cdac.medinfo.sdk.hl7282.baselibs.segments;

import cdac.medinfo.sdk.hl7282.commoninterface.ISegment;

/**
 * SegmentFactory creates instance of Segment.
 */
public class SegmentFactory 
{
	
	/**
	 * Creates instance of Segment using name of segment.
	 * @param strName name of segment
	 * @return ISegment - instance of Segment.
	 */
	public static ISegment createSegment(String strName)
	{
		ISegment objSegment = null;
		
		if(strName == null)
			return null;
		
		if(strName.equalsIgnoreCase("ABS"))
		{
			objSegment = new ABS();
		}
		else if(strName.equalsIgnoreCase("ACC"))
		{
			objSegment = new ACC();
		}
		else if(strName.equalsIgnoreCase("ADD"))
		{
			objSegment = new ADD();
		}
		else if(strName.equalsIgnoreCase("AFF"))
		{
			objSegment = new AFF();
		}
		else if(strName.equalsIgnoreCase("AIG"))
		{
			objSegment = new AIG();
		}
		else if(strName.equalsIgnoreCase("AIL"))
		{
			objSegment = new AIL();
		}
		else if(strName.equalsIgnoreCase("AIP"))
		{
			objSegment = new AIP();
		}
		else if(strName.equalsIgnoreCase("AIS"))
		{
			objSegment = new AIS();
		}
		else if(strName.equalsIgnoreCase("AL1"))
		{
			objSegment = new AL1();
		}
		else if(strName.equalsIgnoreCase("APR"))
		{
			objSegment = new APR();
		}
		else if(strName.equalsIgnoreCase("ARQ"))
		{
			objSegment = new ARQ();
		}
		else if(strName.equalsIgnoreCase("AUT"))
		{
			objSegment = new AUT();
		}
		else if(strName.equalsIgnoreCase("BHS"))
		{
			objSegment = new BHS();
		}
		else if(strName.equalsIgnoreCase("BLC"))
		{
			objSegment = new BLC();
		}
		else if(strName.equalsIgnoreCase("BLG"))
		{
			objSegment = new BLG();
		}
		else if(strName.equalsIgnoreCase("BPO"))
		{
			objSegment = new BPO();
		}
		else if(strName.equalsIgnoreCase("BPX"))
		{
			objSegment = new BPX();
		}
		else if(strName.equalsIgnoreCase("BTS"))
		{
			objSegment = new BTS();
		}
		else if(strName.equalsIgnoreCase("BTX"))
		{
			objSegment = new BTX();
		}
		else if(strName.equalsIgnoreCase("CDM"))
		{
			objSegment = new CDM();
		}
		else if(strName.equalsIgnoreCase("CER"))
		{
			objSegment = new CER();
		}
		else if(strName.equalsIgnoreCase("CM0"))
		{
			objSegment = new CM0();
		}
		else if(strName.equalsIgnoreCase("CM1"))
		{
			objSegment = new CM1();
		}
		else if(strName.equalsIgnoreCase("CM2"))
		{
			objSegment = new CM2();
		}
		else if(strName.equalsIgnoreCase("CNS"))
		{
			objSegment = new CNS();
		}
		else if(strName.equalsIgnoreCase("CON"))
		{
			objSegment = new ConsentSeg();
		}
		else if(strName.equalsIgnoreCase("CSP"))
		{
			objSegment = new CSP();
		}
		else if(strName.equalsIgnoreCase("CSR"))
		{
			objSegment = new CSR();
		}
		else if(strName.equalsIgnoreCase("CSS"))
		{
			objSegment = new CSS();
		}
		else if(strName.equalsIgnoreCase("CTD"))
		{
			objSegment = new CTD();
		}
		else if(strName.equalsIgnoreCase("CTI"))
		{
			objSegment = new CTI();
		}
		else if(strName.equalsIgnoreCase("DB1"))
		{
			objSegment = new DB1();
		}
		else if(strName.equalsIgnoreCase("DG1"))
		{
			objSegment = new DG1();
		}
		else if(strName.equalsIgnoreCase("DRG"))
		{
			objSegment = new DRG();
		}
		else if(strName.equalsIgnoreCase("DSC"))
		{
			objSegment = new DSC();
		}
		else if(strName.equalsIgnoreCase("DSP"))
		{
			objSegment = new DSP();
		}
		else if(strName.equalsIgnoreCase("ECD"))
		{
			objSegment = new ECD();
		}
		else if(strName.equalsIgnoreCase("ECR"))
		{
			objSegment = new ECR();
		}
		else if(strName.equalsIgnoreCase("EDU"))
		{
			objSegment = new EDU();
		}
		else if(strName.equalsIgnoreCase("EQL"))
		{
			objSegment = new EQL();
		}
		else if(strName.equalsIgnoreCase("EQP"))
		{
			objSegment = new EQP();
		}
		else if(strName.equalsIgnoreCase("EQU"))
		{
			objSegment = new EQU();
		}
		else if(strName.equalsIgnoreCase("ERQ"))
		{
			objSegment = new ERQ();
		}
		else if(strName.equalsIgnoreCase("ERR"))
		{
			objSegment = new ERR();
		}
		else if(strName.equalsIgnoreCase("EVN"))
		{
			objSegment = new EVN();
		}
		else if(strName.equalsIgnoreCase("FAC"))
		{
			objSegment = new FAC();
		}
		else if(strName.equalsIgnoreCase("FHS"))
		{
			objSegment = new FHS();
		}
		else if(strName.equalsIgnoreCase("FT1"))
		{
			objSegment = new FT1();
		}
		else if(strName.equalsIgnoreCase("FTS"))
		{
			objSegment = new FTS();
		}
		else if(strName.equalsIgnoreCase("GOL"))
		{
			objSegment = new GOL();
		}
		else if(strName.equalsIgnoreCase("GP1"))
		{
			objSegment = new GP1();
		}
		else if(strName.equalsIgnoreCase("GP2"))
		{
			objSegment = new GP2();
		}
		else if(strName.equalsIgnoreCase("GT1"))
		{
			objSegment = new GT1();
		}
		else if(strName.equalsIgnoreCase("IAM"))
		{
			objSegment = new IAM();
		}
		else if(strName.equalsIgnoreCase("IIM"))
		{
			objSegment = new IIM();
		}
		else if(strName.equalsIgnoreCase("IN1"))
		{
			objSegment = new IN1();
		}
		else if(strName.equalsIgnoreCase("IN2"))
		{
			objSegment = new IN2();
		}
		else if(strName.equalsIgnoreCase("IN3"))
		{
			objSegment = new IN3();
		}
		else if(strName.equalsIgnoreCase("INV"))
		{
			objSegment = new INV();
		}
		else if(strName.equalsIgnoreCase("IPC"))
		{
			objSegment = new IPC();
		}
		else if(strName.equalsIgnoreCase("ISD"))
		{
			objSegment = new ISD();
		}
		else if(strName.equalsIgnoreCase("LAN"))
		{
			objSegment = new LAN();
		}
		else if(strName.equalsIgnoreCase("LCC"))
		{
			objSegment = new LCC();
		}
		else if(strName.equalsIgnoreCase("LCH"))
		{
			objSegment = new LCH();
		}
		else if(strName.equalsIgnoreCase("LDP"))
		{
			objSegment = new LDP();
		}
		else if(strName.equalsIgnoreCase("LOC"))
		{
			objSegment = new LOC();
		}
		else if(strName.equalsIgnoreCase("LRL"))
		{
			objSegment = new LRL();
		}
		else if(strName.equalsIgnoreCase("MFA"))
		{
			objSegment = new MFA();
		}
		else if(strName.equalsIgnoreCase("MFE"))
		{
			objSegment = new MFE();
		}
		else if(strName.equalsIgnoreCase("MFI"))
		{
			objSegment = new MFI();
		}
		else if(strName.equalsIgnoreCase("MRG"))
		{
			objSegment = new MRG();
		}
		else if(strName.equalsIgnoreCase("MSA"))
		{
			objSegment = new MSA();
		}
		else if(strName.equalsIgnoreCase("MSH"))
		{
			objSegment = new MSH();
		}
		else if(strName.equalsIgnoreCase("NCK"))
		{
			objSegment = new NCK();
		}
		else if(strName.equalsIgnoreCase("NDS"))
		{
			objSegment = new NDS();
		}
		else if(strName.equalsIgnoreCase("NK1"))
		{
			objSegment = new NK1();
		}
		else if(strName.equalsIgnoreCase("NPU"))
		{
			objSegment = new NPU();
		}
		else if(strName.equalsIgnoreCase("NSC"))
		{
			objSegment = new NSC();
		}
		else if(strName.equalsIgnoreCase("NST"))
		{
			objSegment = new NST();
		}
		else if(strName.equalsIgnoreCase("NTE"))
		{
			objSegment = new NTE();
		}
		else if(strName.equalsIgnoreCase("OBR"))
		{
			objSegment = new OBR();
		}
		else if(strName.equalsIgnoreCase("OBX"))
		{
			objSegment = new OBX();
		}
		else if(strName.equalsIgnoreCase("ODS"))
		{
			objSegment = new ODS();
		}
		else if(strName.equalsIgnoreCase("ODT"))
		{
			objSegment = new ODT();
		}
		else if(strName.equalsIgnoreCase("OM1"))
		{
			objSegment = new OM1();
		}
		else if(strName.equalsIgnoreCase("OM2"))
		{
			objSegment = new OM2();
		}
		else if(strName.equalsIgnoreCase("OM3"))
		{
			objSegment = new OM3();
		}
		else if(strName.equalsIgnoreCase("OM4"))
		{
			objSegment = new OM4();
		}
		else if(strName.equalsIgnoreCase("OM5"))
		{
			objSegment = new OM5();
		}
		else if(strName.equalsIgnoreCase("OM6"))
		{
			objSegment = new OM6();
		}
		else if(strName.equalsIgnoreCase("OM7"))
		{
			objSegment = new OM7();
		}
		else if(strName.equalsIgnoreCase("ORC"))
		{
			objSegment = new ORC();
		}
		else if(strName.equalsIgnoreCase("ORG"))
		{
			objSegment = new ORG();
		}
		else if(strName.equalsIgnoreCase("OVR"))
		{
			objSegment = new OVR();
		}
		else if(strName.equalsIgnoreCase("PCR"))
		{
			objSegment = new PCR();
		}
		else if(strName.equalsIgnoreCase("PD1"))
		{
			objSegment = new PD1();
		}
		else if(strName.equalsIgnoreCase("PDA"))
		{
			objSegment = new PDA();
		}
		else if(strName.equalsIgnoreCase("PDC"))
		{
			objSegment = new PDC();
		}
		else if(strName.equalsIgnoreCase("PEO"))
		{
			objSegment = new PEO();
		}
		else if(strName.equalsIgnoreCase("PES"))
		{
			objSegment = new PES();
		}
		else if(strName.equalsIgnoreCase("PID"))
		{
			objSegment = new PID();
		}
		else if(strName.equalsIgnoreCase("PR1"))
		{
			objSegment = new PR1();
		}
		else if(strName.equalsIgnoreCase("PRA"))
		{
			objSegment = new PRA();
		}
		else if(strName.equalsIgnoreCase("PRB"))
		{
			objSegment = new PRB();
		}
		else if(strName.equalsIgnoreCase("PRC"))
		{
			objSegment = new PRC();
		}
		else if(strName.equalsIgnoreCase("PRD"))
		{
			objSegment = new PRD();
		}
		else if(strName.equalsIgnoreCase("PSH"))
		{
			objSegment = new PSH();
		}
		else if(strName.equalsIgnoreCase("PTH"))
		{
			objSegment = new PTH();
		}
		else if(strName.equalsIgnoreCase("PV1"))
		{
			objSegment = new PV1();
		}
		else if(strName.equalsIgnoreCase("PV2"))
		{
			objSegment = new PV2();
		}
		else if(strName.equalsIgnoreCase("QAK"))
		{
			objSegment = new QAK();
		}
		else if(strName.equalsIgnoreCase("QID"))
		{
			objSegment = new QID();
		}
		else if(strName.equalsIgnoreCase("QPD"))
		{
			objSegment = new QPD();
		}
		else if(strName.equalsIgnoreCase("QRI"))
		{
			objSegment = new QRI();
		}
		else if(strName.equalsIgnoreCase("RCP"))
		{
			objSegment = new RCP();
		}
		else if(strName.equalsIgnoreCase("RDF"))
		{
			objSegment = new RDF();
		}
		else if(strName.equalsIgnoreCase("RDT"))
		{
			objSegment = new RDT();
		}
		else if(strName.equalsIgnoreCase("RF1"))
		{
			objSegment = new RF1();
		}
		else if(strName.equalsIgnoreCase("RGS"))
		{
			objSegment = new RGS();
		}
		else if(strName.equalsIgnoreCase("RMI"))
		{
			objSegment = new RMI();
		}
		else if(strName.equalsIgnoreCase("ROL"))
		{
			objSegment = new ROL();
		}
		else if(strName.equalsIgnoreCase("RQ1"))
		{
			objSegment = new RQ1();
		}
		else if(strName.equalsIgnoreCase("RQD"))
		{
			objSegment = new RQD();
		}
		else if(strName.equalsIgnoreCase("RXA"))
		{
			objSegment = new RXA();
		}
		else if(strName.equalsIgnoreCase("RXC"))
		{
			objSegment = new RXC();
		}
		else if(strName.equalsIgnoreCase("RXD"))
		{
			objSegment = new RXD();
		}
		else if(strName.equalsIgnoreCase("RXE"))
		{
			objSegment = new RXE();
		}
		else if(strName.equalsIgnoreCase("RXG"))
		{
			objSegment = new RXG();
		}
		else if(strName.equalsIgnoreCase("RXO"))
		{
			objSegment = new RXO();
		}
		else if(strName.equalsIgnoreCase("RXR"))
		{
			objSegment = new RXR();
		}
		else if(strName.equalsIgnoreCase("SAC"))
		{
			objSegment = new SAC();
		}
		else if(strName.equalsIgnoreCase("SCH"))
		{
			objSegment = new SCH();
		}
		else if(strName.equalsIgnoreCase("SFT"))
		{
			objSegment = new SFT();
		}
		else if(strName.equalsIgnoreCase("SID"))
		{
			objSegment = new SID();
		}
		else if(strName.equalsIgnoreCase("SPM"))
		{
			objSegment = new SPM();
		}
		else if(strName.equalsIgnoreCase("SPR"))
		{
			objSegment = new SPR();
		}
		else if(strName.equalsIgnoreCase("STF"))
		{
			objSegment = new STF();
		}
		else if(strName.equalsIgnoreCase("TCC"))
		{
			objSegment = new TCC();
		}
		else if(strName.equalsIgnoreCase("TCD"))
		{
			objSegment = new TCD();
		}
		else if(strName.equalsIgnoreCase("TQ1"))
		{
			objSegment = new TQ1();
		}
		else if(strName.equalsIgnoreCase("TQ2"))
		{
			objSegment = new TQ2();
		}
		else if(strName.equalsIgnoreCase("TXA"))
		{
			objSegment = new TXA();
		}
		else if(strName.equalsIgnoreCase("UB2"))
		{
			objSegment = new UB2();
		}
		else if(strName.equalsIgnoreCase("VAR"))
		{
			objSegment = new VAR();
		}
		else if(strName.equalsIgnoreCase("ARV"))
		{
			objSegment = new ARV();
		}
		else if(strName.equalsIgnoreCase("CDO"))
		{
			objSegment = new CDO();
		}
		else if(strName.equalsIgnoreCase("CON"))
		{
			objSegment = new ConsentSeg();
		}
		else if(strName.equalsIgnoreCase("DMI"))
		{
			objSegment = new DMI();
		}
		else if(strName.equalsIgnoreCase("DPS"))
		{
			objSegment = new DPS();
		}
		else if(strName.equalsIgnoreCase("IAR"))
		{
			objSegment = new IAR();
		}
		else if(strName.equalsIgnoreCase("MCP"))
		{
			objSegment = new MCP();
		}
		else if(strName.equalsIgnoreCase("OMC"))
		{
			objSegment = new OMC();
		}
		else if(strName.equalsIgnoreCase("PAC"))
		{
			objSegment = new PAC();
		}
		else if(strName.equalsIgnoreCase("PM1"))
		{
			objSegment = new PM1();
		}
		else if(strName.equalsIgnoreCase("PRT"))
		{
			objSegment = new PRT();
		}
		else if(strName.equalsIgnoreCase("REL"))
		{
			objSegment = new REL();
		}
		else if(strName.equalsIgnoreCase("RXV"))
		{
			objSegment = new RXV();
		}
		else if(strName.equalsIgnoreCase("SGH"))
		{
			objSegment = new SGH();
		}
		else if(strName.equalsIgnoreCase("SGT"))
		{
			objSegment = new SGT();
		}
		else if(strName.equalsIgnoreCase("SHP"))
		{
			objSegment = new SHP();
		}
		else if(strName.equalsIgnoreCase("UAC"))
		{
			objSegment = new UAC();
		}
		else if(strName.equalsIgnoreCase("DON"))
		{
			objSegment = new DON();
		}
		else if(strName.equalsIgnoreCase("BUI"))
		{
			objSegment = new BUI();
		}
		else if(strName.equalsIgnoreCase("SLT"))
		{
			objSegment = new SLT();
		}
		else if(strName.equalsIgnoreCase("ITM"))
		{
			objSegment = new ITM();
		}
		else if(strName.equalsIgnoreCase("STZ"))
		{
			objSegment = new STZ();
		}
		else if(strName.equalsIgnoreCase("VND"))
		{
			objSegment = new VND();
		}
		else if(strName.equalsIgnoreCase("PKG"))
		{
			objSegment = new PKG();
		}
		else if(strName.equalsIgnoreCase("PCE"))
		{
			objSegment = new PCE();
		}
		else if(strName.equalsIgnoreCase("IVT"))
		{
			objSegment = new IVT();
		}
		else if(strName.equalsIgnoreCase("ILT"))
		{
			objSegment = new ILT();
		}
		else if(strName.equalsIgnoreCase("SCP"))
		{
			objSegment = new SCP();
		}
		else if(strName.equalsIgnoreCase("SDD"))
		{
			objSegment = new SDD();
		}
		else if(strName.equalsIgnoreCase("SCD"))
		{
			objSegment = new SCD();
		}
		else if(strName.equalsIgnoreCase("RFI"))
		{
			objSegment = new RFI();
		}
		else if(strName.equalsIgnoreCase("IVC"))
		{
			objSegment = new IVC();
		}	
		else if(strName.equalsIgnoreCase("PYE"))
		{
			objSegment = new PYE();
		}
		else if(strName.equalsIgnoreCase("PSS"))
		{
			objSegment = new PSS();
		}
		else if(strName.equalsIgnoreCase("PSG"))
		{
			objSegment = new PSG();
		}
		else if(strName.equalsIgnoreCase("PSL"))
		{
			objSegment = new PSL();
		}
		else if(strName.equalsIgnoreCase("ADJ"))
		{
			objSegment = new ADJ();
		}
		else if(strName.equalsIgnoreCase("PMT"))
		{
			objSegment = new PMT();
		}
		else if(strName.equalsIgnoreCase("IPR"))
		{
			objSegment = new IPR();
		}
		return objSegment;
		
	}
}


