001/**
002 * The contents of this file are subject to the Mozilla Public License Version 1.1
003 * (the "License"); you may not use this file except in compliance with the License.
004 * You may obtain a copy of the License at http://www.mozilla.org/MPL/
005 * Software distributed under the License is distributed on an "AS IS" basis,
006 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
007 * specific language governing rights and limitations under the License.
008 *
009 * The Original Code is "ID.java".  Description:
010 * "This class contains functionality used by the ID class
011 * in the version 2.3.0, 2.3.1, 2.4, and 2.5 packages"
012 *
013 * The Initial Developer of the Original Code is University Health Network. Copyright (C)
014 * 2005.  All Rights Reserved.
015 *
016 * Contributor(s): ______________________________________.
017 *
018 * Alternatively, the contents of this file may be used under the terms of the
019 * GNU General Public License (the "GPL"), in which case the provisions of the GPL are
020 * applicable instead of those above.  If you wish to allow use of your version of this
021 * file only under the terms of the GPL and not to allow others to use your version
022 * of this file under the MPL, indicate your decision by deleting  the provisions above
023 * and replace  them with the notice and other provisions required by the GPL License.
024 * If you do not delete the provisions above, a recipient may use your version of
025 * this file under either the MPL or the GPL.
026 *
027 */
028package ca.uhn.hl7v2.model.primitive;
029
030import ca.uhn.hl7v2.model.AbstractPrimitive;
031import ca.uhn.hl7v2.model.Message;
032
033/**
034 * This class contains functionality used by the ID class
035 * in the version 2.3.0, 2.3.1, 2.4, and 2.5 packages
036 *
037 * Note: The class description below has been excerpted from the Hl7 2.4 documentation. Sectional
038 * references made below also refer to the same documentation.
039 *
040 * The value of such a field follows the formatting rules for an ST field except
041 * that it is drawn from a table of legal values. There shall be an HL7 table number
042 * associated with ID data types. An example of an ID field is OBR-25-result status.
043 * This data type should be used only for HL7 tables (see Section 2.7.6, "Table").
044 * The reverse is not true, since in some circumstances it is more appropriate to use
045 * the CE data type for HL7 tables.
046 *
047 * @author <a href="mailto:neal.acharya@uhn.on.ca">Neal Acharya</a>
048 * @author <a href="mailto:bryan.tripp@uhn.on.ca">Bryan Tripp</a>
049 * @version $Revision: 1.1 $ updated on $Date: 2007-02-19 02:24:51 $ by $Author: jamesagnew $
050 */
051@SuppressWarnings("serial")
052public abstract class ID extends AbstractPrimitive {
053
054    private int myTable = 0;
055    
056    /**
057     * @param theMessage message to which this Type belongs
058     */
059    public ID(Message theMessage) {
060        super(theMessage);
061    }
062
063    /**
064     * @param theMessage message to which this Type belongs
065     * @param theTable HL7 table from which values are to be drawn 
066     */
067    public ID(Message theMessage, int theTable) {
068        super(theMessage);
069        myTable = theTable;
070    }
071    
072    /**
073     * @param message message to which this Type belongs
074     * @param theTable HL7 table from which values are to be drawn 
075     */
076    public ID(Message message, Integer theTable) {
077        super(message);
078        myTable = theTable;
079    }
080    
081    /**
082     * @return number of HL7 table from which values should be drawn (defaults to 0) 
083     */
084    public int getTable() {
085        return myTable;
086    }
087    
088    /**
089     * @param theTable HL7 table from which values are to be drawn 
090     */
091    public void setTable(int theTable) {
092        myTable = theTable;        
093    }
094    
095}