001    package ca.uhn.hl7v2.conf.store;
002    import java.io.IOException;
003    import ca.uhn.hl7v2.conf.ProfileException;
004    
005    /**
006     * Created on 27-Aug-2003
007     * @author Neal Acharya
008     * Interface used retreiving and validating codes from user defined and HL7 specific tables
009     * that correspond to a conformance profile.
010     */
011    public interface CodeStore {
012        
013        /**
014         * @param codeSystem a table of codes (for example, HL70001 for administrative sex)
015         *      valid tables are defined in the HL7 table 0396
016         * @return a list of valid codes 
017         * @throws ProfileException
018         *
019         * Retreives all codes for a given conformance profile and codeSystem.
020         */
021        public String[] getValidCodes(String codeSystem) throws ProfileException;
022        
023        /**
024         * @param codeSystem
025         * @return boolean
026         * boolean
027         *
028         * Validates the codeSystem against the input conformance profile. If valid then
029         * output is 'true' else 'false'.
030         */
031        public boolean knowsCodes(String codeSystem);
032        
033        /**
034         * @param codeSystem
035         * @param code
036         * @return boolean
037         * boolean
038         *
039         * Validates the input code value against the input conformance profile and corresponding input
040         * codeSystem. Returns true if the code is valid and false if it isn't.
041         */
042        public boolean isValidCode(String codeSystem, String code);
043        
044    }//end interface