Represents a disposition code. See the specification.
Much of the work is done by the parent class, Section 27, “
class SingleField: Generic
single-character field”. Warning: this is a
fixed-field version, so blank disposition codes are not
For the version of this field that appears in the “short tail” of the pre-2006 protocols, this class will need a new method that scans an optional disposition code.
For the “long tail” version, which is a fixed field but can have blank values, yet another method will be required.
# - - - - - c l a s s D i s p o s i t i o n F i e l d - - - - - class DispositionField(SingleField): '''Represents a disposition code. Exports: as inherited. ''' VALID_CODES = "BDEILMOPSTW"
Uses the parent class's
.scanField() method to
do all the work.
# - - - D i s p o s i t i o n F i e l d . s c a n F i e l d - - - @staticmethod def scanField(encounter, scan, fieldName): '''Scan a fixed-format disposition code. ''' SingleField.scanField(encounter, scan, fieldName, DispositionField, "disposition code")