/**
 * St. Josefs Hospital Wisbaden GmbH
 * 
 * @author Ismet Celebi
 * @date 23.03.2011
 * @package de.joho.portal.hapi.costum.v24.message
 * @file ADT_A01.java
 */
package de.joho.portal.hapi.costum.v24.message;

import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
import ca.uhn.hl7v2.parser.ModelClassFactory;
import de.joho.portal.hapi.costum.v24.segment.ZBE;

public class ADT_A01 extends ca.uhn.hl7v2.model.v24.message.ADT_A01
{

    private static final long serialVersionUID = 5355408673343002793L;

    /**
     * Creates a new ADT_A01 Group with custom ModelClassFactory.
     */
    public ADT_A01(ModelClassFactory factory)
    {
        super(factory);
        init(factory);
    }

    /**
     * Creates a new ADT_A01 Group with DefaultModelClassFactory.
     */
    public ADT_A01()
    {
        super(new DefaultModelClassFactory());
        init(new DefaultModelClassFactory());
    }

    private void init(ModelClassFactory factory)
    {
        try {
            this.add(ZBE.class, false, false);
        } catch (HL7Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * Returns ZBE creates it if necessary
     */
    public ZBE getZBE()
    {
        ZBE ret = null;
        try {
            ret = (ZBE) this.get("ZBE");
        } catch (HL7Exception e) {
            throw new RuntimeException(e);
        }
        return ret;
    }
}
