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.Message;
031
032/**
033 * This class contains functionality used by the ID class
034 * in the version 2.3.0, 2.3.1, 2.4, and 2.5 packages
035 *
036 * Note: The class description below has been excerpted from the Hl7 2.4 documentation. Sectional
037 * references made below also refer to the same documentation.
038 *
039 * The value of such a field follows the formatting rules for an ST field except
040 * that it is drawn from a table of legal values. There shall be an HL7 table number
041 * associated with ID data types. An example of an ID field is OBR-25-result status.
042 * This data type should be used only for HL7 tables (see Section 2.7.6, "Table").
043 * The reverse is not true, since in some circumstances it is more appropriate to use
044 * the CE data type for HL7 tables.
045 *
046 * @author <a href="mailto:neal.acharya@uhn.on.ca">Neal Acharya</a>
047 * @author <a href="mailto:bryan.tripp@uhn.on.ca">Bryan Tripp</a>
048 * @version $Revision: 1.1 $ updated on $Date: 2007-02-19 02:24:51 $ by $Author: jamesagnew $
049 */
050@SuppressWarnings("serial")
051public abstract class ID extends AbstractTextPrimitive {
052
053    private int myTable = 0;
054    
055    /**
056     * @param theMessage message to which this Type belongs
057     */
058    public ID(Message theMessage) {
059        super(theMessage);
060    }
061
062    /**
063     * @param theMessage message to which this Type belongs
064     * @param theTable HL7 table from which values are to be drawn 
065     */
066    public ID(Message theMessage, int theTable) {
067        super(theMessage);
068        myTable = theTable;
069    }
070    
071    /**
072     * @param message message to which this Type belongs
073     * @param theTable HL7 table from which values are to be drawn 
074     */
075    public ID(Message message, Integer theTable) {
076        super(message);
077        myTable = theTable;
078    }
079    
080    /**
081     * @return number of HL7 table from which values should be drawn (defaults to 0) 
082     */
083    public int getTable() {
084        return myTable;
085    }
086    
087    /**
088     * @param theTable HL7 table from which values are to be drawn 
089     */
090    public void setTable(int theTable) {
091        myTable = theTable;        
092    }
093    
094}