Package pyx12 :: Module codes :: Class ExternalCodes
[hide private]

Class ExternalCodes

source code

object --+
         |
        ExternalCodes

Validates an ID against an external list of codes

Instance Methods [hide private]
 
__init__(self, base_path, exclude=None)
Initialize the external list of codes
source code
boolean
isValid(self, key, code, check_dte=None)
Is the code in the list identified by key
source code
 
debug_print(self) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, base_path, exclude=None)
(Constructor)

source code 

Initialize the external list of codes

Parameters:
  • base_path (string) - path to codes.xml
  • exclude (string) - comma separated string of external codes to ignore
Overrides: object.__init__

Note: self.codes - map of a tuple of two dates and a list of codes {codeset_id: (eff_dte, exp_dte, [code_values])}

isValid(self, key, code, check_dte=None)

source code 

Is the code in the list identified by key

Parameters:
  • key (string) - the external codeset identifier
  • code (string) - code to be verified
  • check_dte (string) - YYYYMMDD - Date on which to check code validity. eg 20040514
Returns: boolean
True if code is valid, False if not