Next / Previous / Contents / Shipman's homepage

41. class CloacalField: Cloacal protuberance

Another class derived from Section 27, “class SingleField: Generic single-character field”, this class represents a cloacal protuberance code. Because this field is optional, a space character is included in the VALID_CODES string. For valid codes, see the specification.
# - - - - -   c l a s s   C l o a c a l F i e l d    - - - - -

class CloacalField(SingleField):
    '''Represents a cloacal protuberance code.

    VALID_CODES = "0123 "

    def scanField(encounter, scan, fieldName):
        '''Scan a cloacal protuberance code.
        SingleField.scanField(encounter, scan, fieldName,
                               CloacalField, "cloacal protuberance")