001package ca.uhn.hl7v2.model.primitive;
002
003import ca.uhn.hl7v2.model.Message;
004
005/**
006 * HL7 ID type which also stores a namespace string
007 */
008@SuppressWarnings("serial")
009public class IDWithNamespace extends ID {
010
011        private String myNamespace;
012        private String myHl7Version;
013
014        public IDWithNamespace(Message theMessage, String theHl7Version, String theNamespace, int theTable) {
015                super(theMessage, theTable);
016                myHl7Version = theHl7Version;
017                myNamespace = theNamespace;
018        }
019
020
021        public IDWithNamespace(Message theMessage, String theHl7Version, String theNamespace, Integer theTable) {
022                super(theMessage, theTable);
023                myHl7Version = theHl7Version;
024                myNamespace = theNamespace;
025        }
026        
027        /**
028         * {@inheritDoc}
029         */
030        @Override
031        public String getName() {
032                return "ID";
033        }
034
035        /**
036         * Returns the HL7 version associated with this type instance
037         */
038        public String getVersion() {
039                return myHl7Version;
040        }
041
042        /**
043         * @return Returns the namespace associated with the table for this type
044         */
045        public String getTableNamespace() {
046                return myNamespace;
047        }
048        
049}