/*
* To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package au.gov.qld.health.sit.hl7;

import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.model.AbstractSegment;
import ca.uhn.hl7v2.model.Group;
import ca.uhn.hl7v2.model.Message;
import ca.uhn.hl7v2.model.Type;
import ca.uhn.hl7v2.model.v24.datatype.*;
import ca.uhn.hl7v2.parser.ModelClassFactory;

/**
 *
 * @author vowlesi
 */
public class ZAP extends AbstractSegment {

    public ZAP(Group parent, ModelClassFactory factory) throws HL7Exception {
        super(parent, factory);
        Message message = getMessage();
        Object[] constructorArgs = new Object[]{message};
        Class<? extends Type> type;
        boolean required;
        int maxReps; // only 1 rep
        int maxLength;
        String fieldName;
        // For each in the segment, call this.add()

        // ZAP-1-DEA Schedule, ST, R
        type = ST.class;
        required = true;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "DEA Schedule";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-2-Unknown Field 2, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Unknown Field 2";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-3-Unknown Field 3, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Unknown Field 3";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-4-Unknown Field 4, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Unknown Field 4";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-5-Unknown Field 5, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Unknown Field 5";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-6-Date Written, TS, O
        type = TS.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Date Written";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-7-Safety Cap Preference, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Safety Cap Preference";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-8-Unknown Field 8, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Unknown Field 8";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-9-Script Image Filename, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Script Image Filename";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-10-Refill Contact Phone Number, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Refill Contact Phone Number";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-11-Drug Brand Name, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Drug Brand Name";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-12-Drug Generic Equivalent, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Drug Generic Equivalent";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-13-Refill Information, CE, O
        type = CE.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Refill Information";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-14-Substance Expiration Date, TS, O
        type = TS.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Substance Expiration Date";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-15-Rx Pricing Information, CE, O
        type = CE.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Rx Pricing Information";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-16-Allergy Information, ST, O
        type = ST.class;
        required = false;
        maxReps = 0; // Repeating
        maxLength = 0;
        fieldName = "Allergy Information";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-17-Dispensed Drug Name, CE, O
        type = CE.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Dispensed Drug Name";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-18-Substitution Message, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Substitution Message";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-19-Unknown Field 19, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Unknown Field 19";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-20-Unknown Field 20, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Unknown Field 20";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-21-Patient Notes, ST, O
        type = ST.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 255;
        fieldName = "Patient Notes";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

        // ZAP-22-Payment/Balance Information, CE, O
        type = CE.class;
        required = false;
        maxReps = 1; // only 1 rep
        maxLength = 0;
        fieldName = "Payment/Balance Information";
        this.add(type, required, maxReps, maxLength, constructorArgs, fieldName);

    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getDEASchedule() throws HL7Exception {
        return (ST) super.getField(1, 0); // 1 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP1_DEASchedule() throws HL7Exception {
        return (ST) super.getField(1,0); // 1 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getUnknownField2() throws HL7Exception {
        return (ST) super.getField(2, 0); // 2 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP2_UnknownField2() throws HL7Exception {
        return (ST) super.getField(2,0); // 2 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getUnknownField3() throws HL7Exception {
        return (ST) super.getField(3, 0); // 3 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP3_UnknownField3() throws HL7Exception {
        return (ST) super.getField(3,0); // 3 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getUnknownField4() throws HL7Exception {
        return (ST) super.getField(4, 0); // 4 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP4_UnknownField4() throws HL7Exception {
        return (ST) super.getField(4,0); // 4 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getUnknownField5() throws HL7Exception {
        return (ST) super.getField(5, 0); // 5 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP5_UnknownField5() throws HL7Exception {
        return (ST) super.getField(5,0); // 5 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public TS getDateWritten() throws HL7Exception {
        return (TS) super.getField(6, 0); // 6 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public TS getZAP6_DateWritten() throws HL7Exception {
        return (TS) super.getField(6,0); // 6 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getSafetyCapPreference() throws HL7Exception {
        return (ST) super.getField(7, 0); // 7 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP7_SafetyCapPreference() throws HL7Exception {
        return (ST) super.getField(7,0); // 7 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getUnknownField8() throws HL7Exception {
        return (ST) super.getField(8, 0); // 8 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP8_UnknownField8() throws HL7Exception {
        return (ST) super.getField(8,0); // 8 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getScriptImageFilename() throws HL7Exception {
        return (ST) super.getField(9, 0); // 9 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP9_ScriptImageFilename() throws HL7Exception {
        return (ST) super.getField(9,0); // 9 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getRefillContactPhoneNumber() throws HL7Exception {
        return (ST) super.getField(10, 0); // 10 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP10_RefillContactPhoneNumber() throws HL7Exception {
        return (ST) super.getField(10,0); // 10 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getDrugBrandName() throws HL7Exception {
        return (ST) super.getField(11, 0); // 11 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP11_DrugBrandName() throws HL7Exception {
        return (ST) super.getField(11,0); // 11 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getDrugGenericEquivalent() throws HL7Exception {
        return (ST) super.getField(12, 0); // 12 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP12_DrugGenericEquivalent() throws HL7Exception {
        return (ST) super.getField(12,0); // 12 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public CE getRefillInformation() throws HL7Exception {
        return (CE) super.getField(13, 0); // 13 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public CE getZAP13_RefillInformation() throws HL7Exception {
        return (CE) super.getField(13,0); // 13 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public TS getSubstanceExpirationDate() throws HL7Exception {
        return (TS) super.getField(14, 0); // 14 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public TS getZAP14_SubstanceExpirationDate() throws HL7Exception {
        return (TS) super.getField(14,0); // 14 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public CE getRxPricingInformation() throws HL7Exception {
        return (CE) super.getField(15, 0); // 15 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public CE getZAP15_RxPricingInformation() throws HL7Exception {
        return (CE) super.getField(15,0); // 15 - field num( numbered from 1)
    }
     /**
     * Create a getter for each field
     * @return
     * @throws HL7Exception
     */
    public int getAllergyInformationReps() throws HL7Exception {
        return super.getField(16).length; // 16 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception 
     */
    public int getZAP16_AllergyInformationReps() throws HL7Exception {
        return super.getField(16).length; // 16 - field num( numbered from 1)
    }

    /**
     * Create an accessor for the repeat array
     * @return
     * @throws HL7Exception
     */
    public ST[] getAllergyInformation() throws HL7Exception {
        ST[] retVal = super.getTypedField(16, new ST[0]);
        return retVal;
    }
    /**
     * Create an accessor for the repeat array
     * @return
     * @throws HL7Exception
     */
    public ST[] getZAP16_AllergyInformation() throws HL7Exception {
        ST[] retVal = super.getTypedField(16, new ST[0]);
        return retVal;
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getAllergyInformation(int i) throws HL7Exception {
        return (ST) super.getField(16, i); // 16 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP16_AllergyInformation(int i) throws HL7Exception {
        return (ST) super.getField(16, i); // 16 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public CE getDispensedDrugName() throws HL7Exception {
        return (CE) super.getField(17, 0); // 17 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public CE getZAP17_DispensedDrugName() throws HL7Exception {
        return (CE) super.getField(17,0); // 17 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getSubstitutionMessage() throws HL7Exception {
        return (ST) super.getField(18, 0); // 18 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP18_SubstitutionMessage() throws HL7Exception {
        return (ST) super.getField(18,0); // 18 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getUnknownField19() throws HL7Exception {
        return (ST) super.getField(19, 0); // 19 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP19_UnknownField19() throws HL7Exception {
        return (ST) super.getField(19,0); // 19 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getUnknownField20() throws HL7Exception {
        return (ST) super.getField(20, 0); // 20 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP20_UnknownField20() throws HL7Exception {
        return (ST) super.getField(20,0); // 20 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getPatientNotes() throws HL7Exception {
        return (ST) super.getField(21, 0); // 21 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public ST getZAP21_PatientNotes() throws HL7Exception {
        return (ST) super.getField(21,0); // 21 - field num( numbered from 1)
    }
     /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public CE getPaymentBalanceInformation() throws HL7Exception {
        return (CE) super.getField(22, 0); // 22 - field num( numbered from 1)
    }
    /**
     * Create an accessor for each field
     * @return
     * @throws HL7Exception
     */
    public CE getZAP22_PaymentBalanceInformation() throws HL7Exception {
        return (CE) super.getField(22,0); // 22 - field num( numbered from 1)
    }

}
